Waitman Gobble <uzi...@da3m0n8t3r.com> wrote .. > Andreas Pakulat <ap...@gmx.de> wrote .. > > Hi, > > > > On Tue, Jun 19, 2012 at 8:32 AM, Waitman Gobble > > <uzi...@da3m0n8t3r.com>wrote: > > > > > > > > Hi, > > > > > > I am having an issue with the QTreeView and Key Bindings. It seems when > > > the selection changes from a keyboard event, it does not fire the function > > > bound to the signal. The mouse button causes the function to run as > > > desired. Perhaps I'm missing a setting in the documentation? > > > > > > > Are you expecting your "changeCurrent" slot to be called when navigating > > the tree with keyboard? If so, thats where your error is. You connected the > > pressed-signal of the treeview to that slot and the documentation clearly > > states that this signal is emitted when a mouse button is pressed. If you > > want to catch selection changes of your tree, you should look at the > > signals of the QItemSelectionModel class. You can obtain the > > selection-model from the treeview using the selectionModel member functions > > > > Andreas > > > Thanks Andreas, > > I tried the signals that looked like they would fire the function, I suppose I > left the least likely candidate in the exanple. > I will take a look at the selectionModel member functions. > > I appreciate your help. > > Waitman > > -- > Waitman Gobble > San Jose California USA
This appears to be working for me. connect( tree->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT( changeCurrent(QItemSelection,QItemSelection)), Qt::DirectConnection ) ; Thanks, -- Waitman Gobble San Jose California USA
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest