42#ifndef QTPROPERTYBROWSER_H
43#define QTPROPERTYBROWSER_H
49#include "../commonWidgets.h"
51#if QT_VERSION >= 0x040400
55typedef QLineEdit::EchoMode EchoMode;
65 QList<QtProperty *> subProperties()
const;
69 QString toolTip()
const;
70 QString statusTip()
const;
71 QString whatsThis()
const;
72 QString propertyName()
const;
73 bool isEnabled()
const;
74 bool isModified()
const;
76 bool hasValue()
const;
77 QIcon valueIcon()
const;
78 QString valueText()
const;
79 QString displayText()
const;
81 void setToolTip(
const QString &text);
82 void setStatusTip(
const QString &text);
83 void setWhatsThis(
const QString &text);
84 void setPropertyName(
const QString &text);
85 void setEnabled(
bool enable);
86 void setModified(
bool modified);
93 void propertyChanged();
109 QSet<QtProperty *> properties()
const;
112 QtProperty *addProperty(
const QString &name = QString());
121 virtual bool hasValue(
const QtProperty *property)
const;
122 virtual QIcon valueIcon(
const QtProperty *property)
const;
123 virtual QString valueText(
const QtProperty *property)
const;
124 virtual QString displayText(
const QtProperty *property)
const;
125 virtual EchoMode echoMode(
const QtProperty *)
const;
127 virtual void uninitializeProperty(
QtProperty *property);
147 virtual void managerDestroyed(QObject *manager) = 0;
152template <
class PropertyManager>
159 QSetIterator<PropertyManager *> it(m_managers);
160 while (it.hasNext()) {
161 PropertyManager *manager = it.next();
170 if (m_managers.contains(manager))
172 m_managers.insert(manager);
174 connect(manager, SIGNAL(destroyed(QObject *)),
175 this, SLOT(managerDestroyed(QObject *)));
179 if (!m_managers.contains(manager))
181 disconnect(manager, SIGNAL(destroyed(QObject *)),
182 this, SLOT(managerDestroyed(QObject *)));
184 m_managers.remove(manager);
193 QSetIterator<PropertyManager *> itManager(m_managers);
194 while (itManager.hasNext()) {
195 PropertyManager *m = itManager.next();
205 QWidget *parent) = 0;
207 void managerDestroyed(QObject *manager)
209 QSetIterator<PropertyManager *> it(m_managers);
210 while (it.hasNext()) {
211 PropertyManager *m = it.next();
213 m_managers.remove(m);
221 QSetIterator<PropertyManager *> it(m_managers);
222 while (it.hasNext()) {
223 PropertyManager *m = it.next();
231 QSet<PropertyManager *> m_managers;
232 friend class QtAbstractPropertyEditor;
243 QList<QtBrowserItem *> children()
const;
262 QList<QtProperty *> properties()
const;
263 QList<QtBrowserItem *> items(
QtProperty *property)
const;
265 QList<QtBrowserItem *> topLevelItems()
const;
268 template <
class PropertyManager>
274 if (addFactory(abstractManager, abstractFactory))
299 virtual QWidget *createEditor(
QtProperty *property, QWidget *parent);
308 Q_PRIVATE_SLOT(d_func(),
void slotPropertyInserted(
QtProperty *,
310 Q_PRIVATE_SLOT(d_func(),
void slotPropertyRemoved(
QtProperty *,
312 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDestroyed(
QtProperty *))
313 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDataChanged(
QtProperty *))
317#if QT_VERSION >= 0x040400
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition qtpropertybrowser.h:137
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
QtAbstractEditorFactoryBase(QObject *parent=0)
Definition qtpropertybrowser.h:142
The QtAbstractEditorFactory is the base template class for editor factories.
Definition qtpropertybrowser.h:154
void removePropertyManager(PropertyManager *manager)
Definition qtpropertybrowser.h:177
QtAbstractEditorFactory(QObject *parent)
Definition qtpropertybrowser.h:156
QWidget * createEditor(QtProperty *property, QWidget *parent)
Definition qtpropertybrowser.h:157
virtual void disconnectPropertyManager(PropertyManager *manager)=0
PropertyManager * propertyManager(QtProperty *property) const
Definition qtpropertybrowser.h:190
QSet< PropertyManager * > propertyManagers() const
Definition qtpropertybrowser.h:186
virtual QWidget * createEditor(PropertyManager *manager, QtProperty *property, QWidget *parent)=0
void addPropertyManager(PropertyManager *manager)
Definition qtpropertybrowser.h:168
virtual void connectPropertyManager(PropertyManager *manager)=0
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition qtpropertybrowser.h:255
virtual void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem)=0
void currentItemChanged(QtBrowserItem *)
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition qtpropertybrowser.h:269
virtual void itemRemoved(QtBrowserItem *item)=0
virtual void itemChanged(QtBrowserItem *item)=0
Definition qtpropertybrowser.cpp:1232
The QtAbstractPropertyManager provides an interface for property managers.
Definition qtpropertybrowser.h:102
virtual void initializeProperty(QtProperty *property)=0
void propertyDestroyed(QtProperty *property)
void propertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after)
void propertyChanged(QtProperty *property)
void propertyRemoved(QtProperty *property, QtProperty *parent)
Definition qtpropertybrowser.cpp:79
The QtBrowserItem class represents a property in a property browser instance.
Definition qtpropertybrowser.h:239
Definition qtpropertybrowser.cpp:1104
The QtProperty class encapsulates an instance of a property.
Definition qtpropertybrowser.h:61
QtAbstractPropertyManager * propertyManager() const
Definition qtpropertybrowser.cpp:202
Definition qtpropertybrowser.cpp:57