View Full Version : TableEditDelegate paint issue

17th December 2014, 12:36
I have check box in my tableView ,i paint it using delegate but there is a problem in getting state of checkBox.For example if i disable the table i want the check box to look like SUNKEN state.how can i do this in paint of delegate.Initially i set the state of check box in paint method as STATE_ENABLED.In short i want set the state of checkBox as STATE_SUNKEN when table is disabled and STATE_ENABLED when table is enabled.

17th December 2014, 12:45
If you want the box to be sunken then add a QStyle::State_Sunken flag to the state member of QStyleOptionButton you use wen drawing the check box.

17th December 2014, 12:48
@wysota:I want this sunken state only when the table is disable how will i check this in delegate.

17th December 2014, 14:32
QStyleOptionViewItem.state contains the item state flags.