If click the treeitem,I want to do something.So I use the following code:
connect(this,SIGNAL(itemPressed(QTreeWidgetItem *, int)), this,SLOT(SlotItemClicked(QTreeWidgetItem *, int)));
To copy to clipboard, switch view to plain text mode
the slot SlotItemClicked define as follows:
{
.....
if(item->checkState(0)==Qt::Checked)
hideObj();
else
adddelobj->showObj();
....
}
void SlotItemClicked(QTreeWidgetItem *item, int)))
{
.....
if(item->checkState(0)==Qt::Checked)
hideObj();
else
adddelobj->showObj();
....
}
To copy to clipboard, switch view to plain text mode
but I find that,if the text of the item is clicked,the check state of the item is not changed(that is, the check box is still selected or still unselected,how to deal with it?
Bookmarks