21 #ifndef VENUMPROPERTY_H
22 #define VENUMPROPERTY_H
24 #include <qcompilerdetection.h>
25 #include <QMetaObject>
28 #include <QStringList>
29 #include <QStyleOptionViewItem>
34 #include "../vproperty.h"
50 virtual QVariant
data (
int column =
DPC_Name,
int role = Qt::DisplayRole)
const Q_DECL_OVERRIDE;
57 virtual QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& options,
58 const QAbstractItemDelegate* delegate) Q_DECL_OVERRIDE;
61 virtual QVariant
getEditorData(
const QWidget* editor)
const Q_DECL_OVERRIDE;
64 virtual void setLiterals(
const QStringList &literals);
70 virtual void setValue(
const QVariant& value) Q_DECL_OVERRIDE;
73 virtual QString
type() const Q_DECL_OVERRIDE;
80 Q_REQUIRED_RESULT virtual
VProperty*
clone(
bool include_children = true,
81 VProperty* container =
nullptr) const Q_DECL_OVERRIDE;
86 virtual
void setSetting(const QString& key, const QVariant& value) Q_DECL_OVERRIDE;
89 virtual QVariant
getSetting(const QString& key) const Q_DECL_OVERRIDE;
void currentIndexChanged(int index)
virtual QStringList getLiterals() const
Get the settings. This function has to be implemented in a subclass in order to have an effect.
virtual ~VEnumProperty() Q_DECL_OVERRIDE
Destructor.
virtual void setValue(const QVariant &value) Q_DECL_OVERRIDE
Sets the value of the property.
virtual QStringList getSettingKeys() const Q_DECL_OVERRIDE
Returns the list of keys of the property's settings.
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
Get the data how it should be displayed.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
virtual void setSetting(const QString &key, const QVariant &value) Q_DECL_OVERRIDE
Sets the settings. Available settings:
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.
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 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.
VEnumProperty(const QString &name)
Constructor.
QStringList EnumerationLiterals
The list of possible options to choose from.
virtual void setLiterals(const QStringList &literals)
Sets the enumeration literals.