Unsolved Block keyboard in QDialog
-
Hi
how to block keys like 'Esc' , 'up' , 'Down' , 'Right' ...... on keyboard?
like i pressed 'Esc' key dialog don't close -
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 */} }
-
I want use the keys but don't effect on Dialog
I want set shortcut keys for my app like Qt Creator in Option>Environment>Keyboard when Record button is clicked keys not effect on Dialog & any key is pressed show in a QLineEdit
How can i do this? -
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.