Salome HOME
197bfc22e52ebbf6f73c9d3a35a1c3b7e1de72bb
[modules/shaper.git] / src / ModuleBase / ModuleBase_IntSpinBox.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:      ModuleBase_IntSpinBox.cxx
4 // Author:    Natalia ERMOLAEVA
5 //
6 #include "ModuleBase_IntSpinBox.h"
7
8 #include <QKeyEvent>
9
10 ModuleBase_IntSpinBox::ModuleBase_IntSpinBox(QWidget* theParent)
11 : QSpinBox(theParent)//,
12   //myIsModified(false)
13 {
14   //connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&)));
15 }
16
17 /*void ModuleBase_IntSpinBox::onValueChanged(const QString& theValue)
18 {
19   myIsModified = true;
20 }
21
22 bool ModuleBase_IntSpinBox::isModified() const
23 {
24   return myIsModified;
25 }
26
27 void ModuleBase_IntSpinBox::clearModified()
28 {
29   myIsModified = false;
30 }*/
31
32 void ModuleBase_IntSpinBox::keyPressEvent(QKeyEvent *theEvent)
33 {
34   switch (theEvent->key()) {
35     case Qt::Key_Enter:
36     case Qt::Key_Return: {
37       // do not react to the Enter key, the property panel processes it
38         return;
39     }
40     break;
41     default:
42       break;
43   }
44   QSpinBox::keyPressEvent(theEvent);
45 }
46