21 #ifndef VNUMBERPROPERTY_H
22 #define VNUMBERPROPERTY_H
24 #include <qcompilerdetection.h>
27 #include <QMetaObject>
30 #include <QStringList>
31 #include <QStyleOptionViewItem>
35 #include "../vproperty.h"
55 virtual QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &options,
56 const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE;
59 virtual QVariant
getEditorData(
const QWidget *editor)
const Q_DECL_OVERRIDE;
65 virtual void setSetting(
const QString &key,
const QVariant &value) Q_DECL_OVERRIDE;
68 virtual QVariant
getSetting(
const QString &key)
const Q_DECL_OVERRIDE;
74 virtual QString
type()
const Q_DECL_OVERRIDE;
81 Q_REQUIRED_RESULT
virtual VProperty *
clone(
bool include_children =
true,
82 VProperty *container =
nullptr)
const Q_DECL_OVERRIDE;
110 virtual QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &options,
111 const QAbstractItemDelegate *delegate);
120 virtual void setSetting(
const QString &key,
const QVariant &value);
123 virtual QVariant
getSetting(
const QString &key)
const;
129 virtual QString
type()
const;
Class for holding a double property.
int Precision
Number of decimals after the decimal point.
virtual QString type() const
Returns a string containing the type of the property.
virtual QVariant getEditorData(const QWidget *editor) const
Gets the data from the widget.
DoubleSpinboxProperty(const QString &name, const QMap< QString, QVariant > &settings)
virtual VProperty * clone(bool include_children=true, VProperty *container=NULL) const
Clones this property.
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate)
Returns an editor widget, or NULL if it doesn't supply one.
virtual QVariant getSetting(const QString &key) const
Get the settings. This function has to be implemented in a subclass in order to have an effect.
static const double StandardPrecision
virtual void setSetting(const QString &key, const QVariant &value)
Sets the settings. Available settings:
virtual QStringList getSettingKeys() const
Returns the list of keys of the property's settings.
Class for holding an integer property.
virtual QStringList getSettingKeys() const Q_DECL_OVERRIDE
Returns the list of keys of the property's settings.
virtual void setSetting(const QString &key, const QVariant &value) Q_DECL_OVERRIDE
Sets the settings. Available settings:
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE
Returns an editor widget, or NULL if it doesn't supply one.
SpinboxProperty(const QString &name, const QMap< QString, QVariant > &settings)
static const int StandardMin
static const int StandardMax
virtual QVariant getEditorData(const QWidget *editor) const Q_DECL_OVERRIDE
Gets the data from the widget.
virtual QVariant getSetting(const QString &key) const Q_DECL_OVERRIDE
Get the settings. This function has to be implemented in a subclass in order to have an effect.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.