[Qt-interest] checkbox in table view

Andre Somers andre at familiesomers.nl
Mon Sep 27 07:26:49 CEST 2010


  Op 27-9-2010 6:35, linux newbie schreef:
> Hi,
>
> Can anyone let me know, how to create check box in table view?
>
> First Column has to contain this check box.
>
> I belive it can be done through delegate. If yes, how to change the
> paint method?
The easiest way by far, is to use/return the correct item flags for the 
item that needs to show the check box. See QAbstractItemModel::flags() 
and the Qt::CheckStateRole for the QAbstractItemModel::data() method.

André




More information about the Qt-interest-old mailing list