From 0ba7dcd0f6f04b0eb7b51f4a36fcbbc3d17dd25d Mon Sep 17 00:00:00 2001 From: Thomas Gimpel Date: Sat, 11 Jul 2020 20:01:46 +0200 Subject: [PATCH] Gui: do not drop unhandled key events in *SpinBox::keyPressedEvent() handlers --- src/Gui/QuantitySpinBox.cpp | 2 +- src/Gui/SpinBox.cpp | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 5708d4d0dd..35fcd8aece 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -513,7 +513,7 @@ void Gui::QuantitySpinBox::keyPressEvent(QKeyEvent *event) { if (event->text() == QString::fromUtf8("=") && isBound()) openFormulaDialog(); - else if (!hasExpression()) + else QAbstractSpinBox::keyPressEvent(event); } diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index c0d6114c29..b5a5d2731d 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -405,10 +405,8 @@ void UIntSpinBox::keyPressEvent(QKeyEvent *event) { if (event->text() == QString::fromUtf8("=") && isBound()) openFormulaDialog(); - else { - if (!hasExpression()) - QAbstractSpinBox::keyPressEvent(event); - } + else + QAbstractSpinBox::keyPressEvent(event); } @@ -584,10 +582,8 @@ void IntSpinBox::keyPressEvent(QKeyEvent *event) { if (event->text() == QString::fromUtf8("=") && isBound()) openFormulaDialog(); - else { - if (!hasExpression()) - QAbstractSpinBox::keyPressEvent(event); - } + else + QAbstractSpinBox::keyPressEvent(event); } @@ -762,10 +758,8 @@ void DoubleSpinBox::keyPressEvent(QKeyEvent *event) { if (event->text() == QString::fromUtf8("=") && isBound()) openFormulaDialog(); - else { - if (!hasExpression()) - QAbstractSpinBox::keyPressEvent(event); - } + else + QAbstractSpinBox::keyPressEvent(event); } #include "moc_SpinBox.cpp"