Version: 9.16.0
SMESHGUI_SpinBoxForbiddendRange.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23// SMESH SMESHGUI : GUI for SMESH component
24// File : SMESHGUI_SpinBoxForbiddendRange.h
25// Author : Konstantin Leontev, Open CASCADE S.A.S.
26//
27#ifndef SMESHGUI_SPINBOXFORBIDDENRANGE_H
28#define SMESHGUI_SPINBOXFORBIDDENRANGE_H
29
30// SMESH includes
31#include "SMESHGUI_SpinBox.h"
32
33
34//=================================================================================
35// class : SMESHGUI_SpinBoxForbiddendRange
36// purpose : Allows validating with a range of forbidden values
37//=================================================================================
39{
40 Q_OBJECT
41
42public:
45
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;
49
50 void SetForbiddenRange(const double min, const double max);
51
52protected:
53 virtual bool checkRange(const double value) const override;
54 bool IsValueInRange(const double value) const;
55 double GetValueInRange(const double value) const;
56
57 virtual void showValidationToolTip(const QValidator::State state) const override;
58private:
61
62 mutable bool toolTipFlag = false;
63};
64
65#endif // SMESHGUI_SPINBOXFORBIDDENRANGE_H
66
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Definition: SMESHGUI_SpinBoxForbiddendRange.h:39
double forbiddenMax
Definition: SMESHGUI_SpinBoxForbiddendRange.h:60
double forbiddenMin
Definition: SMESHGUI_SpinBoxForbiddendRange.h:59
Definition: SMESHGUI_SpinBox.h:48