我有一个具有QTableWidget
和正常细胞的表项的组合QLineEdit
。我想知道由QLineEdit
列中的值在表中的数据进行排序的最佳方式。
下面是一个例子。
| customer code | header | message |
------------------------------------------------
| QLineEdit | normal cell | normal cell |
| QLineEdit | normal cell | normal cell |
| QLineEdit | normal cell | normal cell |
| QLineEdit | normal cell | normal cell |
| QLineEdit | normal cell | normal cell |
我想排序的客户代码列,但因为它是一个QLineEdit
(设定setCellWidget()
),该表将不会被它的值进行排序。
我知道我可以把每一个值出来,将它们放置在一个临时对象或行和洗牌周围的行,但是这将是惊人的丑陋和缓慢的。有一个更好的方法吗?
有几种方法可以解决这个,这里有一对夫妇的想法: