Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how can i react to the keyboard ESC event before closeEditor() when i edit a QTreeWidgetItem...
-
how can i react to the keyboard ESC event before closeEditor() when i edit a QTreeWidgetItem...
-
Try this code:
void YourTreeWidget::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { // Your code here event->accept(); } else { // default implementation QTreeView::keyPressEvent(event); } }
-
but the closeEditor() still reacts before keyPressEvent.........