28 #ifndef VOBJECTPROPERTY_H
29 #define VOBJECTPROPERTY_H
31 #include <qcompilerdetection.h>
33 #include <QMetaObject>
36 #include <QStringList>
37 #include <QStyleOptionViewItem>
42 #include "../vproperty.h"
60 virtual QVariant
data (
int column =
DPC_Name,
int role = Qt::DisplayRole)
const Q_DECL_OVERRIDE;
67 virtual QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& options,
68 const QAbstractItemDelegate* delegate) Q_DECL_OVERRIDE;
71 virtual QVariant
getEditorData(
const QWidget* editor)
const Q_DECL_OVERRIDE;
80 virtual void setValue(
const QVariant& value) Q_DECL_OVERRIDE;
83 virtual QString
type() const Q_DECL_OVERRIDE;
90 Q_REQUIRED_RESULT virtual
VProperty*
clone(
bool include_children = true,
91 VProperty* container =
nullptr) const Q_DECL_OVERRIDE;
93 static
int indexOfObject(const
QMap<QString, quint32> &objects, const QString &
object);
QMap< QString, quint32 > m_objects
The list of possible objects.
virtual ~VObjectProperty() Q_DECL_OVERRIDE
Destructor.
VObjectProperty(const QString &name)
Constructor.
static int indexOfObject(const QMap< QString, quint32 > &objects, const QString &object)
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
Get the data how it should be displayed.
virtual void setValue(const QVariant &value) Q_DECL_OVERRIDE
Sets the value of the property.
void currentIndexChanged(int index)
virtual QVariant getEditorData(const QWidget *editor) const Q_DECL_OVERRIDE
Gets the data from the widget.
QVector< QString > m_indexList
void setObjectsList(const QMap< QString, quint32 > &objects)
Sets the objects list.
void fillListItems(QComboBox *box, const QMap< QString, quint32 > &list) const
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.
virtual QMap< QString, quint32 > getObjects() const
Get the settings. This function has to be implemented in a subclass in order to have an effect.