Solved Signal for QListView when the selection changes?
-
Is there a similar signal of
QListView
such asQComboBox::currentIndexChanged()
?I would like to change other display items depending on which row is currently the active row in a
QListView
... or do I have to subclass it? It would be nice if there were a signal I could connect to a slot in my dialog. -
QListView is derived from QAbstractItemView - there are some signals which should help you
-
@Christian-Ehrlicher I looked, but all of the available signals only seem to be emitted when an item is clicked, or otherwise activated ... what I'd like is to have notification when the user navigates the rows up or down by pressing the arrow keys.
QListWidget
offerscurrentRowChanged
, which is exactly what I want ... only this should work forQListView
since I have used the model/view design principle here. -
When you want a selection change, you have to connect to the selectionModel().
btw: please distinguish between current and selected cells - these are two different things!
-
@Christian-Ehrlicher Thank you, Christian ... this is exactly what I needed to know.
I realize that there is a difference between current and selected, but since I have only single selection enabled in the list view, it will do quite nicely.
(marking as SOLVED)