1 // *************************************************************************************************
3 // QPropertyEditor v 0.1
5 // --------------------------------------
6 // Copyright (C) 2007 Volker Wiendl
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or any later version.
14 // This library 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 GNU
17 // Lesser General Public License for more details.
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 // *************************************************************************************************
25 #include "QPropertyEditorWidget.h"
26 #include "QPropertyModel.h"
27 #include "QVariantDelegate.h"
30 QPropertyEditorWidget::QPropertyEditorWidget(QWidget
* parent
/*= 0*/) : QTreeView(parent
) {
31 m_model
= new QPropertyModel(this);
33 setItemDelegate(new QVariantDelegate(this));
37 QPropertyEditorWidget::~QPropertyEditorWidget() {}
39 void QPropertyEditorWidget::addObject(QObject
* propertyObject
) {
40 m_model
->addItem(propertyObject
);
44 void QPropertyEditorWidget::setObject(QObject
* propertyObject
) {
47 addObject(propertyObject
);
50 void QPropertyEditorWidget::updateObject(QObject
* propertyObject
) {
51 m_model
->updateItem(propertyObject
);
54 void QPropertyEditorWidget::setCustomPropertyCB(UserTypeCB callback
) {
55 m_model
->setCustomPropertyCB(callback
);