itom  4.1.0
QPropertyEditorWidget.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 QPROPERTYEDITORWIDGET_H_
26 #define QPROPERTYEDITORWIDGET_H_
27 
28 #ifdef __APPLE__
29 extern "C++" {
30 #endif
31 
32 #include "defines.h"
33 
34 #include <QtWidgets/qtreeview.h>
35 
36 class QPropertyModel;
37 class Property;
38 
60 class QPROPERTYEDITOR_EXPORT QPropertyEditorWidget : public QTreeView
61 {
62  Q_OBJECT
63 public:
64 
68  typedef Property* (*UserTypeCB)(const QString& name, QObject* propertyObject, Property* parent);
69 
76  QPropertyEditorWidget(QWidget* parent = 0);
77 
79  virtual ~QPropertyEditorWidget();
80 
87  void addObject(QObject* propertyObject);
88 
97  void setObject(QObject* propertyObject);
98 
104  void updateObject(QObject* propertyObject);
105 
111  void registerCustomPropertyCB(UserTypeCB callback);
112 
117  void unregisterCustomPropertyCB(UserTypeCB callback);
118 
119  void setSorted(bool value);
120 
121  bool sorted() const;
122 
123 protected:
124  void mousePressEvent(QMouseEvent *event);
125  void keyPressEvent(QKeyEvent *event);
126 
127 private:
130 
131  bool m_sorted;
132 
133 signals:
134 
135 private slots :
136  void sortedAction(bool checked);
137 
138 
139 };
140 
141 #ifdef __APPLE__
142 }
143 #endif
144 
145 #endif
QPropertyModel * m_model
The Model for this view.
Definition: QPropertyEditorWidget.h:129
Definition: QPropertyModel.h:38
The QPropertyEditorWidget offers an easy to use mechanism to visualize properties of a class inherite...
Definition: QPropertyEditorWidget.h:60
Definition: Property.h:40