[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 :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.