Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qlistview Selectionchanged event not found in Qt?

Tags:

qt

qlistview

Qlistview Selectionchanged event not found in Qt What is the equivalent of selection changed event in Qlistview in Qt?

like image 897
Bokambo Avatar asked Jun 03 '11 05:06

Bokambo


1 Answers

The selectionChanged signal is generated by the QItemSelectionModel attached to the view, not the view widget itself.

You can get that model by calling selectionModel() on the view object, or by adding your own with setSelectionModel().

This applies both to QListView and QListWidget, since this behavior is handled by the QAbstractItemView which both inherit.

(Class hierarchy is QAbstractItemView < QListView < QListWidget.)

See Handling selections in item view for more information.

like image 151
Mat Avatar answered Nov 20 '22 04:11

Mat