Search code examples
qtqlistview

Qlistview Selectionchanged event not found in Qt?


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


Solution

  • It's just about selection, so the focus?

    When using QListView:

    QAbstractItemView::currentChanged ( const QModelIndex & current, const QModelIndex & previous )
    

    When using QListWidget, you can also use:

    QListWidget::currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous )
    

    Docs: