Qt: add Key_Enter wherever Key_Return is used
This commit is contained in:
@@ -119,7 +119,7 @@ class StatusBarButton(QPushButton):
|
|||||||
self.func()
|
self.func()
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
def keyPressEvent(self, e):
|
||||||
if e.key() == Qt.Key_Return:
|
if e.key() in [ Qt.Key_Return, Qt.Key_Enter ]:
|
||||||
self.func()
|
self.func()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class NodesListWidget(QTreeWidget):
|
|||||||
menu.exec_(self.viewport().mapToGlobal(position))
|
menu.exec_(self.viewport().mapToGlobal(position))
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if event.key() in [ Qt.Key_F2, Qt.Key_Return ]:
|
if event.key() in [ Qt.Key_F2, Qt.Key_Return, Qt.Key_Enter ]:
|
||||||
self.on_activated(self.currentItem(), self.currentColumn())
|
self.on_activated(self.currentItem(), self.currentColumn())
|
||||||
else:
|
else:
|
||||||
QTreeWidget.keyPressEvent(self, event)
|
QTreeWidget.keyPressEvent(self, event)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class EnterButton(QPushButton):
|
|||||||
self.clicked.connect(func)
|
self.clicked.connect(func)
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
def keyPressEvent(self, e):
|
||||||
if e.key() == Qt.Key_Return:
|
if e.key() in [ Qt.Key_Return, Qt.Key_Enter ]:
|
||||||
self.func()
|
self.func()
|
||||||
|
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ class MyTreeView(QTreeView):
|
|||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if self.itemDelegate().opened:
|
if self.itemDelegate().opened:
|
||||||
return
|
return
|
||||||
if event.key() in [ Qt.Key_F2, Qt.Key_Return ]:
|
if event.key() in [ Qt.Key_F2, Qt.Key_Return, Qt.Key_Enter ]:
|
||||||
self.on_activated(self.selectionModel().currentIndex())
|
self.on_activated(self.selectionModel().currentIndex())
|
||||||
return
|
return
|
||||||
super().keyPressEvent(event)
|
super().keyPressEvent(event)
|
||||||
|
|||||||
Reference in New Issue
Block a user