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 <qitemdelegate.h>
29
30class QSignalMapper;
31
35class QVariantDelegate : public QItemDelegate
36{
37 Q_OBJECT
38
39public:
44 QVariantDelegate(QObject* parent = 0);
47
56 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
57
63 virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
64
71 virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
72
74 virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
75
76private:
77 void parseEditorHints(QWidget* editor, const QString& editorHints) const;
78
79 QSignalMapper* m_finishedMapper;
80};
81#endif
Definition QVariantDelegate.h:38
virtual ~QVariantDelegate()
Destructor.
QVariantDelegate(QObject *parent=0)
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
QItemDelegate implementation.
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const