itom
Loading...
Searching...
No Matches
EnumProperty.h
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 Lesser General Public License as published by the Free Software
12// Foundation; either version 2 of the License, or (at your option) any later
13// version.
14//
15// This program is distributed in the hope that it will be useful, but WITHOUT
16// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public License along with
20// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21// Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22// http://www.gnu.org/copyleft/lesser.txt.
23//
24// *************************************************************************************************
25#ifndef __ENUMPROPERTY_H__
26#define __ENUMPROPERTY_H__
27
28#include "Property.h"
29#include <qcombobox.h>
30#include <qmetaobject.h>
31#include <qmetatype.h>
32#include <qstringlist.h>
33
42class EnumProperty : public Property
43{
44 Q_OBJECT
45
46public:
47 EnumProperty(const QString& name = QString(), QObject* propertyObject = 0, QObject* parent = 0);
48
50 virtual QVariant value(int role = Qt::UserRole) const;
52 virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option);
54 virtual bool setEditorData(QWidget* editor, const QVariant& data);
56 virtual QVariant editorData(QWidget* editor);
57
58private slots:
60 void valueChanged(const QString item);
61
62private:
64 QStringList m_enum;
65};
66#endif
Definition EnumProperty.h:43
virtual bool setEditorData(QWidget *editor, const QVariant &data)
Definition EnumProperty.cpp:95
QStringList m_enum
Definition EnumProperty.h:64
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option)
Definition EnumProperty.cpp:81
virtual QVariant value(int role=Qt::UserRole) const
Definition EnumProperty.cpp:54
void valueChanged(const QString item)
Definition EnumProperty.cpp:139
virtual QVariant editorData(QWidget *editor)
Definition EnumProperty.cpp:122
Definition Property.h:41
QObject * propertyObject()
Definition Property.h:77