PDA

View Full Version : Getting a Signal when the current selection in a QTreeView changes.



Doug Broadwell
26th August 2007, 04:35
I have a QTreeView connected to a QDirModel. I need a signal whenever the user changes the highlighted item in the tree view - whether by mouse or by up/dn arrow keys (I have to change the active state of a button depending upon if it is pointing at a directory or a file). I cannot find any such signal in either the QTreeView nor the QDirModel.

How to implement?

Thanks,
Doug

marcel
26th August 2007, 07:05
See the signals from QItemSelectionModel( for example, the currentChanged signal). You must connect to those.
You can access the selection model for your view with QTreeView::selectionModel().

Regards