[Qt-interest] how to set check box on QTableWidget's header
Malyushytsky, Alex
alex at wai.com
Wed Jun 30 23:15:54 CEST 2010
// first set the Flag that it item is checkable
item->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled );
// then you can set state
item->setCheckState(Qt::Unchecked);
Regards,
Alex
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of jiangzhw2008
Sent: Wednesday, June 30, 2010 3:26 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] how to set check box on QTableWidget's header
Importance: High
I'm trying to implement a table widget which has checkable items in it.
And I want to place a check box on the horizontal header to let user "Check All" and "Uncheck All" by checking or unchecking this check box.
Does anybody know how to do this?
I tried the following:
QTableWidgetItem* item = new QTableWidgetItem("Check");
item->setCheckState(Qt::Checked);
table->setHorizontalHeaderItem(0, item);
But the header does not have a check box on it.
Hope someone can help me...
Thanks in advance
Zhengwei JIANG
---------------------------------------------------------------------------------------------------
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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100630/59dd4ddc/attachment.html
More information about the Qt-interest-old
mailing list