Block keyboard in QDialog
Unsolved
General and Desktop
-
Hi
Block for a Dialog or for whole application ?In many cases, using event filter might work good.
https://wiki.qt.io/How_to_catch_enter_key
or for just dialog
MyDialog::keyPressEvent(QKeyEvent *e) { if(e->key() != Qt::Key_Escape) QDialog::keyPressEvent(e); else {/* minimize */} }
-
-
Create event filter to filter required keys and install filter on ur dialog which is not supposed to receive the keys. This filter you can install for any widget you want.