QStandardItem checkbox signals
Hello.
I've got a QTreeView with a column having QStandardItem, which is set as a checkbox.
How do I get notified for checkbox clicks?
In other words, how do I connect to checkbox's signals? My model where I set the QStandardItem to checkable is not subclassed from QObject.
Thanks.
t
Re: QStandardItem checkbox signals
It means that you use delegate in model/view("which is set as a checkbox")?
I thought that you should connect checkbox's signal in your delegate.
Re: QStandardItem checkbox signals
Quote:
Originally Posted by
tvj4218
Hello.
I've got a QTreeView with a column having QStandardItem, which is set as a checkbox.
How do I get notified for checkbox clicks?
In other words, how do I connect to checkbox's signals? My model where I set the QStandardItem to checkable is not subclassed from QObject.
Thanks.
t
I think you meant QTreeWidget, and to receive the signal your model (as you call it) must inherit from QObject.
Connect to QTableWidget's itemClicked(QTableWidgetItem * item) signal, and get item's checkState()
Re: QStandardItem checkbox signals
The itemClicked signal gets generated even when the user clicks on the cell containing the checkbox and not the checkbox itself. I only want a signal when the user clicks on the checkbox. Is there a way to do that?
Thanks.
t
Re: QStandardItem checkbox signals
No, but you can check the checkbox status, anyway.
Re: QStandardItem checkbox signals
The checkbox status is already changed by the time you get to the slot, so end up getting the new checkbox status.