41#ifndef QTPROPERTYBROWSER_H
42#define QTPROPERTYBROWSER_H
44#include <QtWidgets/QWidget>
46#include <QtWidgets/QLineEdit>
48#if QT_VERSION >= 0x040400
53# if defined(COMPILE_QTPROPERTYBROWSER)
54# define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllexport)
56# define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllimport)
59#define QT_QTPROPERTYBROWSER_EXPORT
112 QString toolTip()
const;
113 QString statusTip()
const;
114 QString whatsThis()
const;
115 QString propertyName()
const;
116 bool isEnabled()
const;
117 bool isModified()
const;
119 bool hasValue()
const;
120 QIcon valueIcon()
const;
121 QString valueText()
const;
122 QString displayText()
const;
124 void setToolTip(
const QString& text);
125 void setStatusTip(
const QString& text);
126 void setWhatsThis(
const QString& text);
127 void setPropertyName(
const QString& text);
128 void setEnabled(
bool enable);
129 void setModified(
bool modified);
136 void propertyChanged();
151 QSet<QtProperty*> properties()
const;
154 QtProperty* addProperty(
const QString& name = QString());
163 virtual bool hasValue(
const QtProperty* property)
const;
164 virtual QIcon valueIcon(
const QtProperty* property)
const;
165 virtual QString valueText(
const QtProperty* property)
const;
166 virtual QString displayText(
const QtProperty* property)
const;
169 virtual void uninitializeProperty(
QtProperty* property);
175#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
197template <
class PropertyManager>
202 QSetIterator<PropertyManager*> it(m_managers);
203 while (it.hasNext()) {
204 PropertyManager* manager = it.next();
212 if (m_managers.contains(manager)) {
215 m_managers.insert(manager);
217 connect(manager, SIGNAL(destroyed(QObject*)),
221 if (!m_managers.contains(manager)) {
224 disconnect(manager, SIGNAL(destroyed(QObject*)),
227 m_managers.remove(manager);
234 QSetIterator<PropertyManager*> itManager(m_managers);
235 while (itManager.hasNext()) {
236 PropertyManager* m = itManager.next();
246 QWidget* parent) = 0;
249 QSetIterator<PropertyManager*> it(m_managers);
250 while (it.hasNext()) {
251 PropertyManager* m = it.next();
253 m_managers.remove(m);
260 QSetIterator<PropertyManager*> it(m_managers);
261 while (it.hasNext()) {
262 PropertyManager* m = it.next();
270 QSet<PropertyManager*> m_managers;
305 template <
class PropertyManager>
311 if (addFactory(abstractManager, abstractFactory)) {
337 virtual QWidget* createEditor(
QtProperty* property, QWidget* parent);
345#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
350 Q_PRIVATE_SLOT(d_func(),
void slotPropertyInserted(
QtProperty*,
352 Q_PRIVATE_SLOT(d_func(),
void slotPropertyRemoved(
QtProperty*,
354 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDestroyed(
QtProperty*))
355 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDataChanged(
QtProperty*))
359#if QT_VERSION >= 0x040400
Definition PersistenceManager.h:30
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition qtpropertybrowser.h:182
virtual void breakConnection(QtAbstractPropertyManager *manager)=0
virtual void managerDestroyed(QObject *manager)=0
QtAbstractEditorFactoryBase(QObject *parent=nullptr)
Definition qtpropertybrowser.h:187
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
The QtAbstractEditorFactory is the base template class for editor factories.
Definition qtpropertybrowser.h:198
void removePropertyManager(PropertyManager *manager)
Definition qtpropertybrowser.h:220
virtual QWidget * createEditor(PropertyManager *manager, QtProperty *property, QWidget *parent)=0
QtAbstractEditorFactory(QObject *parent)
Definition qtpropertybrowser.h:200
virtual void disconnectPropertyManager(PropertyManager *manager)=0
QWidget * createEditor(QtProperty *property, QWidget *parent) override
Definition qtpropertybrowser.h:201
friend class QtAbstractPropertyEditor
Definition qtpropertybrowser.h:271
PropertyManager * propertyManager(QtProperty *property) const
Definition qtpropertybrowser.h:232
virtual void connectPropertyManager(PropertyManager *manager)=0
QSet< PropertyManager * > propertyManagers() const
Definition qtpropertybrowser.h:229
void managerDestroyed(QObject *manager) override
Definition qtpropertybrowser.h:248
void addPropertyManager(PropertyManager *manager)
Definition qtpropertybrowser.h:211
Definition qtpropertybrowser.cpp:1182
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition qtpropertybrowser.h:292
virtual void itemChanged(QtBrowserItem *item)=0
virtual void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem)=0
void currentItemChanged(QtBrowserItem *)
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition qtpropertybrowser.h:306
virtual void itemRemoved(QtBrowserItem *item)=0
Definition qtpropertybrowser.cpp:76
The QtAbstractPropertyManager provides an interface for property managers.
Definition qtpropertybrowser.h:144
void propertyDestroyed(QtProperty *property)
void propertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after)
void propertyChanged(QtProperty *property)
virtual void initializeProperty(QtProperty *property)=0
void propertyRemoved(QtProperty *property, QtProperty *parent)
Definition qtpropertybrowser.cpp:1062
The QtBrowserItem class represents a property in a property browser instance.
Definition qtpropertybrowser.h:277
Definition qtpropertybrowser.cpp:55
The QtProperty class encapsulates an instance of a property.
Definition qtpropertybrowser.h:104
QtAbstractPropertyManager * propertyManager() const
Definition qtpropertybrowser.cpp:187
#define QT_QTPROPERTYBROWSER_EXPORT
Definition qtpropertybrowser.h:59
QLineEdit::EchoMode EchoMode
Definition qtpropertybrowser.h:62