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.........