Skip to content

Commit

Permalink
Gui: do not drop unhandled key events in *SpinBox::keyPressedEvent() …
Browse files Browse the repository at this point in the history
…handlers
  • Loading branch information
thomasgi1 authored and wwmayer committed Jul 12, 2020
1 parent 2ae385f commit 33499a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Gui/QuantitySpinBox.cpp
Expand Up @@ -513,7 +513,7 @@ void Gui::QuantitySpinBox::keyPressEvent(QKeyEvent *event)
{
if (event->text() == QString::fromUtf8("=") && isBound())
openFormulaDialog();
else if (!hasExpression())
else
QAbstractSpinBox::keyPressEvent(event);
}

Expand Down
18 changes: 6 additions & 12 deletions src/Gui/SpinBox.cpp
Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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"

0 comments on commit 33499a5

Please sign in to comment.