shortcuts customization: handle numpad keys as numpad keys

This commit is contained in:
Garux 2022-12-13 17:32:46 +06:00
parent 48a6cf3c9e
commit 85d6e4b0fd

View File

@ -298,10 +298,12 @@ class Single_QKeySequenceEdit : public QKeySequenceEdit
protected:
void keyPressEvent( QKeyEvent *e ) override {
QKeySequenceEdit::keyPressEvent( e );
if( e->modifiers() & Qt::KeypadModifier ) //. workaround Qt issue: Qt::KeypadModifier is ignored
setKeySequence( QKeySequence( keySequence()[0] | Qt::KeypadModifier ) );
if( QKeySequence_valid( keySequence() ) )
clearFocus(); // trigger editingFinished(); via losing focus 🙉
// because this can still receive focus loss b4 getting deleted (practically because modal msgbox)
// and two editingFinished(); b no good
// and two editingFinished(); b no good
}
void focusOutEvent( QFocusEvent *event ) override {
editingFinished();