[Qt-interest] sorting on more than one "column"
Malyushytsky, Alex
alex at wai.com
Tue Nov 3 23:42:54 CET 2009
There is no ready standard support for complex sorting, but check the following
http://doc.trolltech.com/4.1/qsortfilterproxymodel.html
Regards,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Mihail Naydenov
Sent: Tuesday, November 03, 2009 7:51 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] sorting on more than one "column"
Does Qt support sorting on more then one field at a time?
(Like, in some view, clicking on a header will sort, 'shift'-clicking once more on diff column, it will further sort the results)
If not in views, is it supported in some model
tbl->setSort(tbl->fieldIndex("country"), Qt::AscendingOrder);
tbl->setSort(tbl->fieldIndex("location"), Qt::DescendingOrder);
tbl->select();
I had hoped this will sort first based on country, then further sort the cities in this countries.
But no, the second sort overrides the first :)
I imagine the only way to do this is using QSqlQuery directly. Is this correct?
(except, manually sorting the results afterwards, of course)
Thank You
MihailNaydenov
_______________________________________________
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