itom
Loading...
Searching...
No Matches
FlagsProperty.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 __FLAGSPROPERTY_H__
26#define __FLAGSPROPERTY_H__
27
28#include "Property.h"
29#include <qmetaobject.h>
30#include <qmetatype.h>
31#include <qstringlist.h>
32
41class FlagsProperty : public Property
42{
43 Q_OBJECT
44
45public:
47 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:
61
62private:
64 QStringList m_enum;
65 QVector<int> m_enumIndices;
66 QWidget* m_comboBox;
67 bool m_inModification;
68};
69#endif
Definition FlagsProperty.h:42
void checkedIndexesChanged()
Definition FlagsProperty.cpp:172
virtual QVariant editorData(QWidget *editor)
Definition FlagsProperty.cpp:148
virtual bool setEditorData(QWidget *editor, const QVariant &data)
Definition FlagsProperty.cpp:111
QStringList m_enum
Definition FlagsProperty.h:64
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option)
Definition FlagsProperty.cpp:97
virtual QVariant value(int role=Qt::UserRole) const
Definition FlagsProperty.cpp:60
Definition Property.h:41
QObject * propertyObject()
Definition Property.h:77