X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_DoubleSpinBox.h;h=c26d17f038ecc4627ca46c3f128ea8bb5c9a93f6;hb=22a466df8defc1c65441ca593608d04e3c9eeb6c;hp=87cbe6e84e665075d2fe425b3cafbd8834b9a4af;hpb=7df901531d6c7df50b82058bece27151629c9298;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.h b/src/ModuleBase/ModuleBase_DoubleSpinBox.h index 87cbe6e84..c26d17f03 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.h +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.h @@ -11,6 +11,9 @@ #include #include +#include + +class QKeyEvent; /** * \ingroup GUI @@ -48,6 +51,19 @@ Q_OBJECT /// Validate current value virtual QValidator::State validate(QString&, int&) const; + /// Change enable/disable internal state to emit key press event + /// \param theEnable if true, the signal is emitted + /// \return the previous value + bool enableKeyPressEvent(const bool& theEnable); + + /// Imitation of disable control value. If theEnable is false, the control becomes + /// read only and base color is disabled. + void setValueEnabled(const bool& theEnable); + +signals: + /// The signal about key release on the control, that corresponds to the attribute + void enterReleased(); + protected slots: /// Called on text changed virtual void onTextChanged(const QString&); @@ -55,13 +71,24 @@ Q_OBJECT protected: /// Removes extra trailing zero symbols QString removeTrailingZeroes(const QString&) const; + /// Called on key press event + virtual void keyReleaseEvent(QKeyEvent* theEvent); + + /// Called on key press event + virtual void keyPressEvent(QKeyEvent* theEvent); private: + // boolen flag whether the key event is emitted. The default value is false + bool myIsEmitKeyPressEvent; + /// Is clear flag bool myCleared; /// Precision value int myPrecision; + + /// Cashed color of active base palette + QColor myEnabledBaseColor; }; #endif