[Qt-interest] Allow sorting only for one column of the QTableWidget

Malyushytsky, Alex alex at wai.com
Wed Mar 25 10:18:06 CET 2009


I don't have QT 4.5.
What I would try in QT 4.4:

- disable sorting completely:  void setSortingEnabled ( bool enable )
- make horizontalHeader () clickable - setClickable ( bool clickable )
- create custom slot which will ignore  event or call sortByColumn(... )  or     sortItems( ); // I have no idea why developers did not make them virtual

- connect your custom slot to one of the horizontal header
( QHeaderView * horizontalHeader () const )
signals ( potentially - sectionClicked ( int logicalIndex ) )

Hope this helps, I have not tried it.

Regards,
    Alex


________________________________________
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Iurii Gordiienko
Sent: Wednesday, March 25, 2009 12:07 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Allow sorting only for one column of the QTableWidget

Hi
I need allow sorting only for one column of the QTableWidget. How can I forbid the Sorting of others colums from QTableWidget?
Qt-4.5
Thanks


---------------------------------------------------------------------------------------------------
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