QStandardItem setCheckable(true) & catch any signal when the user click on the checkbox
-
1, when setCheckable(true), the item can be checked by the user; otherwise, the user cannot check the item.
2, maybe you can try itemChanged as you signal.
3, also you can use QCheckBox::stateChanged ( int state )
void QCheckBox::stateChanged ( int state ) [signal]
This signal is emitted whenever the check box's state changes, i.e. whenever the user checks or unchecks it -
Perhaps you can use "QxtListWidget":http://libqxt.bitbucket.org/doc/0.6/qxtlistwidget.html instead? It provides a dedicated signal for this.
-
Other idea.
In the view have the
@void QAbstractItemView::clicked ( const QModelIndex & index ) [signal]@
In the model check the column you use for the checkbox from the argumentlist.
Call your slot as function and you have the same working, but with a small detour.
So it is more the view then the model that calls the slot you want when a item is clicked.
Hope this helps a bit.
greetz