PDA

View Full Version : Checkable item in tree model



zlatko
11th May 2007, 11:14
Hi all !
I need to build treview with checkable items. I try use model/view approach to this. As template i use some class TreeModel(actually don't remember really caption ) from qt samples that derived from QAbstractItemModel. In virtual method Qt::ItemFlags flags(const QModelIndex &index) const i try returnt combination of needed item falgs, alike Qt::ItemIsEnabled | Qt::ItemIsUserCheckable but my item in tree still not checkable...
Have i ask exhaustive question ?
Pls help...

[EDITED]
Play with role Qt::CheckStateRole in data() ?

wysota
11th May 2007, 11:35
Yes, you have to make sure data() returns an appropriate value of the check state role for the index.