29 #ifndef INT_PROPERTY_H 30 #define INT_PROPERTY_H 58 const char* changed_slot =
nullptr,
59 QObject* receiver =
nullptr);
68 bool setValue(
const QVariant& new_value)
override;
94 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option)
override;
112 #endif // INT_PROPERTY_H
A single element of a property tree, with a name, value, description, and possibly children...
void setInt(int new_value)
Set the value of this property to the given integer.
Property specialized to provide max/min enforcement for integers.
IntProperty(const QString &name=QString(), int default_value=0, const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
Constructor.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option) override
Overridden to create a QSpinBox with the min and max set and with a signal/slot connection to setInt(...
double min(double a, double b)
virtual int getInt() const
Return the internal property value as an integer.
bool setValue(const QVariant &new_value) override
Set the new value for this property. Returns true if the new value is different from the old value...
virtual QVariant getValue() const
Return the value of this Property as a QVariant. If the value has never been set, an invalid QVariant...
double max(double a, double b)