Enter key press is not working in QListWidget in pyside2
-
I can't find any signals for when the enter key was pressed on an item in the list (QStandardListItem). Can't seem to find any keypress events either.
Is it possible to "hook up" QListView to an event just like that? How?
@yashi95
There is no such Qt class asQStandardListItem.For a
QListView, go to https://doc.qt.io/qt-5/qlistview-members.html and search forkey, e.g.QAbstractItemView::keyPressEventis that's what you really want. Or you can always go via aneventFilter()if required. -
@yashi95
There is no such Qt class asQStandardListItem.For a
QListView, go to https://doc.qt.io/qt-5/qlistview-members.html and search forkey, e.g.QAbstractItemView::keyPressEventis that's what you really want. Or you can always go via aneventFilter()if required. -
@yashi95
https://doc.qt.io/qt-5/eventsandfilters.html#event-filters
https://doc.qt.io/qt-5/qobject.html#eventFilterThough why
QListView::keyPressedis not acceptable to you I do not know. -
@yashi95
https://doc.qt.io/qt-5/eventsandfilters.html#event-filters
https://doc.qt.io/qt-5/qobject.html#eventFilterThough why
QListView::keyPressedis not acceptable to you I do not know. -
Hi,
Are you looking for the QListWidget::itemActivated signal ?