RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
qvariantdelegate.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 COLORSELECTIONBUTTON_H_
24 #define COLORSELECTIONBUTTON_H_
25 
26 #include <QtWidgets/QItemDelegate>
27 
28 class QSignalMapper;
29 
33 class QVariantDelegate : public QItemDelegate
34 {
35  Q_OBJECT
36 
37 public:
42  QVariantDelegate(QObject* parent = 0);
44  virtual ~QVariantDelegate();
45 
54  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
55 
61  virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
62 
69  virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
70 
72  virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
73 
74 private:
75  void parseEditorHints(QWidget* editor, const QString& editorHints) const;
76 
77  QSignalMapper* m_finishedMapper;
78 
79 private slots:
80  void editorDestroyed(QObject*);
81 
82 Q_SIGNALS:
83  void beginPropertyEdit() const;
84  void finishPropertyEdit() const;
85 };
86 #endif
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void finishPropertyEdit() const
QVariantDelegate(QObject *parent=0)
virtual ~QVariantDelegate()
Destructor.
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
QItemDelegate implementation.
void beginPropertyEdit() const
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const