itom
Loading...
Searching...
No Matches
QVariantDelegate.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 COLORSELECTIONBUTTON_H_
26#define COLORSELECTIONBUTTON_H_
27
28#include "defines.h"
29#include <qitemdelegate.h>
30
31class QSignalMapper;
32class Property;
33
37class QVariantDelegate : public QItemDelegate
38{
39 Q_OBJECT
40
41public:
46 QVariantDelegate(QObject* parent = 0);
48 virtual ~QVariantDelegate();
49
58 QWidget* createEditor(
59 QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
60
66 virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
67
75 virtual void setModelData(
76 QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
77
79 virtual void updateEditorGeometry(
80 QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
81
82 QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
83
84protected:
85 Property* propertyFromModel(const QModelIndex &index) const;
86
87private:
88 void parseEditorHints(QWidget* editor, const QString& editorHints) const;
89
90 // deprecated, can be removed in a future version. It is not used any more.
91 QSignalMapper* m_finishedMapper;
92};
93#endif
Definition Property.h:41
Definition QVariantDelegate.h:38
virtual ~QVariantDelegate()
Destructor.
Definition QVariantDelegate.cpp:59
QVariantDelegate(QObject *parent=0)
Definition QVariantDelegate.cpp:36
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
Definition QVariantDelegate.cpp:116
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
QItemDelegate implementation.
Definition QVariantDelegate.cpp:173
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Definition QVariantDelegate.cpp:144
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition QVariantDelegate.cpp:80