PDA

View Full Version : TableEditDelegate paint issue



anbu01
17th December 2014, 13:36
hi,
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.

wysota
17th December 2014, 13: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.

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

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