https://bugs.kde.org/show_bug.cgi?id=251161
Thomas Fischer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Thomas Fischer <fischer unix-ag uni-kl de> 2010-11-23 13:27:56 --- The problem is that the list widget uses a lexicographical comparison by default. To solve this issue, instead of using QTreeWidgetItem objects to represent search results, a new class has to derived here which re-implements the sorting function (more specifically, how two entries are compared). My idea would be as follows (not compiled, not tested, may not work at all!): const int ColumnDate=2; class MatchListViewItem : public QTreeWidgetItem { private: MatchListView *parent; public: MatchListViewItem(MatchListView *p) : QTreeWidgetItem(p), parent(p) { // empty }; bool operator<( const QTreeWidgetItem & other ) const { switch(parent->sortColumn()) { case ColumnDate: return QDate::fromString(text(ColumnDate)).operator<(QDate::fromString(other.text(ColumnDate))); default: return QTreeWidgetItem::operator<(other); } } }; In function SearchWindow::slotAddMsg, use this class instead of QTreeWidgetItem when adding more results. Maybe I'll test and refine this code later today... -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ Kdepim-bugs mailing list [email protected] https://mail.kde.org/mailman/listinfo/kdepim-bugs
