Could we see some code? I don't have any problems catching Qt::Key_Up or Qt::Key_Down in keyPressEvent().
Could we see some code? I don't have any problems catching Qt::Key_Up or Qt::Key_Down in keyPressEvent().
J-P Nurmi
Unfortunately my dev machine crashed the other day...so I no longer have that code. However, looking at the situation I'm wondering if I'm over-complicating the problem.
I want to call a function whenever a new row is selected within a QTreeView. Right now I have this QTreeView connected using both the "entered" and "pressed" signal. This works fine as long as the user clicks and selects a new row. However, if the user uses the up and down arrow keys to change rows, my function does not get called. Rather then capturing the up and down arrow keys, is there an easier way to capture this event?
Thanks in advance.
Yeah, you can use QAbstractItemView::selectionModel() to retrieve the item selection model and connect to one of it's signals, like QItemSelectionModel::selectionChanged().
J-P Nurmi
Thanks JPN...I'll give that a shot!
Bookmarks