RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
enumproperty.h
Go to the documentation of this file.
1 // *************************************************************************************************
2 //
3 // QPropertyEditor v 0.3
4 //
5 // --------------------------------------
6 // Copyright (C) 2007 Volker Wiendl
7 // Acknowledgements to Roman alias banal from qt-apps.org for the Enum enhancement
8 //
9 //
10 // The QPropertyEditor Library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation version 3 of the License
13 //
14 // The Horde3D Scene Editor is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 //
22 // *************************************************************************************************
23 #ifndef __ENUMPROPERTY_H__
24 #define __ENUMPROPERTY_H__
25 
26 #include <QtCore/QStringList>
27 #include <QtCore/QMetaObject>
28 #include <QtCore/QMetaEnum>
29 #include <QtCore/QMetaProperty>
30 #include <QtWidgets/QComboBox>
31 #include "Property.h"
32 
41 class EnumProperty : public Property
42 {
43  Q_OBJECT
44 
45 public:
46  EnumProperty(const QString& name = QString(), QObject* propertyObject = 0, QObject* parent = 0);
47 
49  virtual QVariant value(int role = Qt::UserRole) const;
51  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option);
53  virtual bool setEditorData(QWidget *editor, const QVariant& data);
55  virtual QVariant editorData(QWidget *editor);
56 
57 private slots:
59  virtual void valueChanged(int);
60 
61 protected:
63  QStringList m_enum;
64 };
65 #endif
EnumProperty(const QString &name=QString(), QObject *propertyObject=0, QObject *parent=0)
virtual QVariant editorData(QWidget *editor)
QStringList m_enum
Definition: enumproperty.h:63
virtual QVariant value(int role=Qt::UserRole) const
virtual bool setEditorData(QWidget *editor, const QVariant &data)
QObject * propertyObject()
Definition: property.h:66
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option)