Gui: support of range checks in DlgExpressionInput
This commit is contained in:
@@ -46,6 +46,19 @@ namespace Gui {
|
||||
|
||||
namespace Dialog {
|
||||
|
||||
class GuiExport NumberRange
|
||||
{
|
||||
public:
|
||||
void setRange(double minimum, double maximum);
|
||||
void clearRange();
|
||||
void throwIfOutOfRange(const Base::Quantity&) const;
|
||||
|
||||
private:
|
||||
double minimum{};
|
||||
double maximum{};
|
||||
bool defined{false};
|
||||
};
|
||||
|
||||
class GuiExport DlgExpressionInput : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -54,6 +67,8 @@ public:
|
||||
explicit DlgExpressionInput(const App::ObjectIdentifier & _path, std::shared_ptr<const App::Expression> _expression, const Base::Unit &_impliedUnit, QWidget *parent = nullptr);
|
||||
~DlgExpressionInput() override;
|
||||
|
||||
void setRange(double minimum, double maximum);
|
||||
void clearRange();
|
||||
std::shared_ptr<App::Expression> getExpression() const { return expression; }
|
||||
|
||||
bool discardedFormula() const { return discarded; }
|
||||
@@ -81,6 +96,7 @@ private:
|
||||
App::ObjectIdentifier path;
|
||||
bool discarded;
|
||||
const Base::Unit impliedUnit;
|
||||
NumberRange numberRange;
|
||||
|
||||
int minimumWidth;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user