[Solved] QTreeView CheckBox checked:unchecked signal ?
-
I have a treeView for which i am using a QStandardItemModel, For each QStandardItem i am setting
@item->setCheckable(true);
item->setCheckState(Qt::Checked);@This displays a checkbox with the text for the tree nodes. How can i emit a signal when checkbox is checked : unchecked .
I tried to connect@connect(treeModel,SIGNAL(itemChanged(QStandardItem*)),SLOT(onItemChanged(const QStandardItem*)));@
but this doesnt seems to work.
Thanks
Edit : There was a small bug I changed the code to
@connect(treeModel,SIGNAL(itemChanged(QStandardItem*)),SLOT(onItemChanged(QStandardItem*)));@
now it works :)