On Fri, 28 Dec 2007 03:45:55 -0800 (PST), purest2 wrote:

> I am now trying to write a similar program, however the systems people have
> upgraded us to PYQT4.
>
> all the old classes are listed as out-of-date, so i am using the new stuff.
> i am using a treeView and the nodes are QStandardItems. it is easy enough
> to make them checkable:
>        
>         void setCheckable ( bool checkable )
>
> but I cant see any way of making them automatically controll the child
> nodes, and i dont see how i can write it myself as i cant even find a
> signal to tell me the state has changed.

QStandardItemModel's itemChanged() signal is what you're looking for:

http://www.riverbankcomputing.com/Docs/PyQt4/html/qstandarditemmodel.html#itemChanged

In the slot you connect to this signal, iterate over the QStandardItem
children and update their checked states with the setCheckState() method
as usual.

David


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to