1 // Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_SpinBoxForbiddendRange.h
25 // Author : Konstantin Leontev, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_SPINBOXFORBIDDENRANGE_H
28 #define SMESHGUI_SPINBOXFORBIDDENRANGE_H
31 #include "SMESHGUI_SpinBox.h"
34 //=================================================================================
35 // class : SMESHGUI_SpinBoxForbiddendRange
36 // purpose : Allows validating with a range of forbidden values
37 //=================================================================================
38 class SMESHGUI_EXPORT SMESHGUI_SpinBoxForbiddendRange : public SMESHGUI_SpinBox
43 SMESHGUI_SpinBoxForbiddendRange(QWidget*);
44 ~SMESHGUI_SpinBoxForbiddendRange();
46 virtual void stepBy(const int steps) override;
47 virtual double valueFromText(QString const& text) const override;
48 virtual QValidator::State validate(QString& text, int& pos) const override;
50 void SetForbiddenRange(const double min, const double max);
53 virtual bool checkRange(const double value) const override;
54 bool IsValueInRange(const double value) const;
55 double GetValueInRange(const double value) const;
57 virtual void showValidationToolTip(const QValidator::State state) const override;
62 mutable bool toolTipFlag = false;
65 #endif // SMESHGUI_SPINBOXFORBIDDENRANGE_H