41 const QString& description,
43 const char* changed_slot,
45 :
Property(name, default_value, description, parent, changed_slot, receiver)
70 QSpinBox* editor =
new QSpinBox(parent);
71 editor->setFrame(
false);
73 connect(editor, SIGNAL(valueChanged(
int)),
this, SLOT(
setInt(
int)));
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
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.
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(...
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...