Hello!
Could you tell me how should I implement the override of operator< in QTreeWidgetItem?
I am asking because I can't find source code of original QTreeWidgetItem implementation in Python and I just don't know how it looks like.
Hello!
Could you tell me how should I implement the override of operator< in QTreeWidgetItem?
I am asking because I can't find source code of original QTreeWidgetItem implementation in Python and I just don't know how it looks like.
hi,
i have the same question. did you solve it ?
I receive private messages with question whether I found the answer to my question. Unfortunately, I still don't know how to override operator. I even posted exactly the same question on PyQT mailling list: http://article.gmane.org/gmane.comp....iding+operator
Again, no response I got...
I promise to post solution as soon as I find the answer .
Please don't hesitate to post your own solution in this thread if you have it ...
hi, I'm sorry that I forgot to post solution i have found some time later:
Qt Code:
def __init__(self, parent=None): def __lt__(self, otherItem): column = self.treeWidget().sortColumn() if column == 0 or column == 6 or column == 7 or column == 8: return float( self.text(column) ) < float( otherItem.text(column) ) else: return self.text(column) < otherItem.text(column)To copy to clipboard, switch view to plain text mode
or http://stackoverflow.com/questions/3...ewidget-column
Last edited by univerz; 19th September 2011 at 19:30.
kosset (19th September 2011)
Bookmarks