[Qt-interest] Sorting QListWidget case sensitive
Malyushytsky, Alex
alex at wai.com
Tue Aug 31 20:43:11 CEST 2010
>> Seems ridiculous to have to reproduce all of the behaviour of QListWidget and add a QSortFilterProxy to achieve standard behaviour in both Windows and Mac file explorers
Sorting is handled by appropriate itemmodel.
http://doc.trolltech.com/4.6/qabstractitemmodel.html#sort
So you derive class from appropriate item model. QAbstractListModel probably will work for QListView derived class as QListWidget is (if you really need QListWidget).
Override sort function the way you want and Set model to the view:
virtual void setModel ( QAbstractItemModel * model )
Do you feel like re-written Qt now?
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Tony Rietwyk
Sent: Monday, August 30, 2010 8:30 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Sorting QListWidget case sensitive
Hi Everybody,
I've checked the documentation, but can't see anything in QListWidget, QListView or QAbstractItemModel to specify that text is to be sorted case insensitive. Have I missed something?
Seems ridiculous to have to reproduce all of the behaviour of QListWidget and add a QSortFilterProxy to achieve standard behaviour in both Windows and Mac file explorers!
Thanks,
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
“Please consider our environment before printing this email.”
More information about the Qt-interest-old
mailing list