Dear All
For QTreeView I would like to change the model index by arrow keys. When I press down key I would like the model index to change like I click on the row.... Is there any signal for this?
Dear All
For QTreeView I would like to change the model index by arrow keys. When I press down key I would like the model index to change like I click on the row.... Is there any signal for this?
You have to reimp QWidget/QTreeView::keyPressEvent() or install an event handler if you want that functionality even if your treeview does not have the focus.
We have keyPressEvent but problem we have is,
when we move with arrow keys on the tree, model index does not change...
AFAIK standard behavior is that you can change selection in views with arrow key by default. You can get signals from QItemSelectionModel which you can get with QTreeView::selectionModel()
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
Dear My "Guru" friend...
I have all ready tried your smart idea, but it didn't work! Thank you for your smart idea! The selection you are talking about could be done with mouse, I am talking a selection with a mouse, user should navigate around the tree without mouse....
Last edited by aekilic; 27th February 2010 at 14:58.
Sorry for the late replies
The problem I had was from the qkeyevent,
Normaly on the widget when users hits to arrov key tree view comes to focus, and after that widget does not listen the key event... So there is no signal to get the selection. Do I need to re implement qtreeview?
Bookmarks