PyQt(Python+Qt)学习随笔:QListWidget对项进行排序的sortItems方法

QListWidget的sortItems方法用于对列表部件中所有项按参数进行排序,相关调用语法如下:

sortItems(Qt.SortOrder order = Qt.AscendingOrder)

枚举类型Qt.SortOrder用于指定排序是按升序排序还是降序排序,取值及含义如下:

  • AscendingOrder:值为0,表示升序排序
  • DescendingOrder:值为1,表示降序排序

老猿Python,跟老猿学Python!

原文地址:https://www.cnblogs.com/LaoYuanPython/p/12570529.html