#include <QKeyEvent>
ModuleBase_IntSpinBox::ModuleBase_IntSpinBox(QWidget* theParent)
-: QSpinBox(theParent),
- myIsModified(false)
+: QSpinBox(theParent)//,
+ //myIsModified(false)
{
- connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&)));
+ //connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&)));
}
-void ModuleBase_IntSpinBox::onValueChanged(const QString& theValue)
+/*void ModuleBase_IntSpinBox::onValueChanged(const QString& theValue)
{
myIsModified = true;
}
void ModuleBase_IntSpinBox::clearModified()
{
myIsModified = false;
+}*/
+
+void ModuleBase_IntSpinBox::keyPressEvent(QKeyEvent *theEvent)
+{
+ switch (theEvent->key()) {
+ case Qt::Key_Enter:
+ case Qt::Key_Return: {
+ // do not react to the Enter key, the property panel processes it
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ QSpinBox::keyPressEvent(theEvent);
}
+