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
121 QString toolTip()
const;
122 QString statusTip()
const;
123 QString whatsThis()
const;
124 QString propertyName()
const;
125 bool isEnabled()
const;
126 bool isModified()
const;
128 bool hasValue()
const;
129 QIcon valueIcon()
const;
130 QString valueText()
const;
131 QString displayText()
const;
133 void setToolTip(
const QString& text);
134 void setStatusTip(
const QString& text);
135 void setWhatsThis(
const QString& text);
136 void setPropertyName(
const QString& text);
137 void setEnabled(
bool enable);
138 void setModified(
bool modified);
145 void propertyChanged();
160 QSet<QtProperty*> properties()
const;
163 QtProperty* addProperty(
const QString& name = QString());
172 virtual bool hasValue(
const QtProperty* property)
const;
173 virtual QIcon valueIcon(
const QtProperty* property)
const;
174 virtual QString valueText(
const QtProperty* property)
const;
175 virtual QString displayText(
const QtProperty* property)
const;
178 virtual void uninitializeProperty(
QtProperty* property);
184 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
206 template <
class PropertyManager>
211 QSetIterator<PropertyManager*> it(m_managers);
212 while (it.hasNext()) {
213 PropertyManager* manager = it.next();
221 if (m_managers.contains(manager)) {
224 m_managers.insert(manager);
226 connect(manager, SIGNAL(destroyed(QObject*)),
230 if (!m_managers.contains(manager)) {
233 disconnect(manager, SIGNAL(destroyed(QObject*)),
236 m_managers.remove(manager);
243 QSetIterator<PropertyManager*> itManager(m_managers);
244 while (itManager.hasNext()) {
245 PropertyManager* m = itManager.next();
255 QWidget* parent) = 0;
258 QSetIterator<PropertyManager*> it(m_managers);
259 while (it.hasNext()) {
260 PropertyManager* m = it.next();
262 m_managers.remove(m);
269 QSetIterator<PropertyManager*> it(m_managers);
270 while (it.hasNext()) {
271 PropertyManager* m = it.next();
279 QSet<PropertyManager*> m_managers;
314 template <
class PropertyManager>
320 if (addFactory(abstractManager, abstractFactory)) {
346 virtual QWidget* createEditor(
QtProperty* property, QWidget* parent);
354 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
359 Q_PRIVATE_SLOT(d_func(),
void slotPropertyInserted(
QtProperty*,
361 Q_PRIVATE_SLOT(d_func(),
void slotPropertyRemoved(
QtProperty*,
363 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDestroyed(
QtProperty*))
364 Q_PRIVATE_SLOT(d_func(),
void slotPropertyDataChanged(
QtProperty*))
368 #if QT_VERSION >= 0x040400
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition: qtpropertybrowser.h:191
virtual void breakConnection(QtAbstractPropertyManager *manager)=0
virtual void managerDestroyed(QObject *manager)=0
QtAbstractEditorFactoryBase(QObject *parent=nullptr)
Definition: qtpropertybrowser.h:196
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
The QtAbstractEditorFactory is the base template class for editor factories.
Definition: qtpropertybrowser.h:207
void removePropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:229
virtual QWidget * createEditor(PropertyManager *manager, QtProperty *property, QWidget *parent)=0
QtAbstractEditorFactory(QObject *parent)
Definition: qtpropertybrowser.h:209
virtual void disconnectPropertyManager(PropertyManager *manager)=0
QWidget * createEditor(QtProperty *property, QWidget *parent) override
Definition: qtpropertybrowser.h:210
friend class QtAbstractPropertyEditor
Definition: qtpropertybrowser.h:280
PropertyManager * propertyManager(QtProperty *property) const
Definition: qtpropertybrowser.h:241
virtual void connectPropertyManager(PropertyManager *manager)=0
QSet< PropertyManager * > propertyManagers() const
Definition: qtpropertybrowser.h:238
void managerDestroyed(QObject *manager) override
Definition: qtpropertybrowser.h:257
void addPropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:220
Definition: qtpropertybrowser.cpp:1193
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:301
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:315
virtual void itemRemoved(QtBrowserItem *item)=0
Definition: qtpropertybrowser.cpp:76
The QtAbstractPropertyManager provides an interface for property managers.
Definition: qtpropertybrowser.h:153
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:1073
The QtBrowserItem class represents a property in a property browser instance.
Definition: qtpropertybrowser.h:286
Definition: qtpropertybrowser.cpp:55
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:113
QtAbstractPropertyManager * propertyManager() const
Definition: qtpropertybrowser.cpp:196
#define QT_QTPROPERTYBROWSER_EXPORT
Definition: qtpropertybrowser.h:59
QLineEdit::EchoMode EchoMode
Definition: qtpropertybrowser.h:62