|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
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
117 QList<QtProperty*> subProperties()
const;
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;
177 virtual void initializeProperty(
QtProperty* property) = 0;
178 virtual void uninitializeProperty(
QtProperty* property);
184 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
194 virtual QWidget* createEditor(
QtProperty* property, QWidget* parent) = 0;
201 virtual void managerDestroyed(QObject* manager) = 0;
206 template <
class PropertyManager>
211 QSetIterator<PropertyManager*> it(
m_managers);
212 while (it.hasNext()) {
213 PropertyManager* manager = it.next();
226 connect(manager, SIGNAL(destroyed(QObject*)),
233 disconnect(manager, SIGNAL(destroyed(QObject*)),
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();
269 QSetIterator<PropertyManager*> it(
m_managers);
270 while (it.hasNext()) {
271 PropertyManager* m = it.next();
290 QList<QtBrowserItem*> children()
const;
308 QList<QtProperty*> properties()
const;
309 QList<QtBrowserItem*> items(
QtProperty* property)
const;
311 QList<QtBrowserItem*> topLevelItems()
const;
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
372 #endif // QTPROPERTYBROWSER_H
void removeSubTree(QtProperty *property, QtProperty *parentProperty)
Definition: qtpropertybrowser.cpp:1266
bool hasValue() const
Definition: qtpropertybrowser.cpp:259
QtAbstractPropertyManager * q_ptr
Definition: qtpropertybrowser.cpp:77
QtPropertyPrivate(QtAbstractPropertyManager *manager)
Definition: qtpropertybrowser.cpp:94
void propertyRemoved(QtProperty *property, QtProperty *parentProperty) const
Definition: qtpropertybrowser.cpp:509
QtBrowserItem * parent() const
Definition: qtpropertybrowser.cpp:1143
QString m_whatsThis
Definition: qtpropertybrowser.cpp:105
void addChild(QtBrowserItem *index, QtBrowserItem *after)
Definition: qtpropertybrowser.cpp:1091
void setStatusTip(const QString &text)
Definition: qtpropertybrowser.cpp:318
QtProperty * addProperty(const QString &name=QString())
Definition: qtpropertybrowser.cpp:748
QtAbstractPropertyManager(QObject *parent=nullptr)
Definition: qtpropertybrowser.cpp:635
friend class QtProperty
Definition: qtpropertybrowser.h:181
QMap< QtProperty *, QList< QtProperty * > > m_propertyToParents
Definition: qtpropertybrowser.cpp:1217
QMap< QtProperty *, QtBrowserItem * > m_topLevelPropertyToIndex
Definition: qtpropertybrowser.cpp:1219
QtBrowserItem * topLevelItem(QtProperty *property) const
Definition: qtpropertybrowser.cpp:1729
QMap< QtAbstractPropertyBrowser *, QMap< QtAbstractPropertyManager *, QtAbstractEditorFactoryBase * > > Map1
Definition: qtpropertybrowser.cpp:1187
QtBrowserItem * m_currentItem
Definition: qtpropertybrowser.cpp:1223
void propertyInserted(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty) const
Definition: qtpropertybrowser.cpp:514
void propertyRemoved(QtProperty *property, QtProperty *parent)
QList< QtProperty * > subProperties() const
Definition: qtpropertybrowser.cpp:189
void managerDestroyed(QObject *manager) override
Definition: qtpropertybrowser.h:257
QtAbstractPropertyBrowser * q_ptr
Definition: qtpropertybrowser.cpp:1194
bool addFactory(QtAbstractPropertyManager *abstractManager, QtAbstractEditorFactoryBase *abstractFactory)
Definition: qtpropertybrowser.cpp:1896
QList< QtBrowserItem * > m_topLevelIndexes
Definition: qtpropertybrowser.cpp:1220
QSet< PropertyManager * > m_managers
Definition: qtpropertybrowser.h:279
QtAbstractPropertyBrowser *const m_browser
Definition: qtpropertybrowser.cpp:1081
void removeChild(QtBrowserItem *index)
Definition: qtpropertybrowser.cpp:1099
virtual QtProperty * createProperty()
Definition: qtpropertybrowser.cpp:767
QtBrowserItem(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent)
Definition: qtpropertybrowser.cpp:1174
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:301
#define QT_QTPROPERTYBROWSER_EXPORT
Definition: qtpropertybrowser.h:59
void removeBrowserIndex(QtBrowserItem *index)
Definition: qtpropertybrowser.cpp:1395
void setEnabled(bool enable)
Definition: qtpropertybrowser.cpp:362
void addPropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:220
QtProperty(QtAbstractPropertyManager *manager)
Definition: qtpropertybrowser.cpp:144
virtual void breakConnection(QtAbstractPropertyManager *manager)=0
void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty)
Definition: qtpropertybrowser.cpp:1371
QString whatsThis() const
Definition: qtpropertybrowser.cpp:223
QtBrowserItem * addProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1771
The QtBrowserItem class represents a property in a property browser instance.
Definition: qtpropertybrowser.h:286
QWidget * createEditor(QtProperty *property, QWidget *parent) override
Definition: qtpropertybrowser.h:210
virtual ~QtProperty()
Definition: qtpropertybrowser.cpp:158
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:113
QSet< QtProperty * > m_parentItems
Definition: qtpropertybrowser.cpp:100
void propertyDestroyed(QtProperty *property)
Definition: qtpropertybrowser.cpp:497
void clearIndex(QtBrowserItem *index)
Definition: qtpropertybrowser.cpp:1421
void unsetFactoryForManager(QtAbstractPropertyManager *manager)
Definition: qtpropertybrowser.cpp:1926
QSet< QtProperty * > m_properties
Definition: qtpropertybrowser.cpp:87
QString statusTip() const
Definition: qtpropertybrowser.cpp:214
QtAbstractPropertyBrowserPrivate()
Definition: qtpropertybrowser.cpp:1226
void setCurrentItem(QtBrowserItem *)
Definition: qtpropertybrowser.cpp:1963
friend class QtAbstractPropertyEditor
Definition: qtpropertybrowser.h:280
QLineEdit::EchoMode EchoMode
Definition: qtpropertybrowser.h:62
bool isEnabled() const
Definition: qtpropertybrowser.cpp:241
virtual bool hasValue(const QtProperty *property) const
Definition: qtpropertybrowser.cpp:680
QtAbstractPropertyBrowser * browser() const
Definition: qtpropertybrowser.cpp:1170
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition: qtpropertybrowser.h:315
QtBrowserItemPrivate * d_ptr
Definition: qtpropertybrowser.h:295
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
void setWhatsThis(const QString &text)
Definition: qtpropertybrowser.cpp:332
virtual EchoMode echoMode(const QtProperty *) const
Definition: qtpropertybrowser.cpp:735
void propertyChanged(QtProperty *property) const
Definition: qtpropertybrowser.cpp:505
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition: qtpropertybrowser.h:191
QtAbstractPropertyManagerPrivate * d_ptr
Definition: qtpropertybrowser.h:182
Definition: qtpropertybrowser.cpp:1193
QtAbstractPropertyBrowser(QWidget *parent=nullptr)
Definition: qtpropertybrowser.cpp:1667
QtAbstractEditorFactory(QObject *parent)
Definition: qtpropertybrowser.h:209
QString valueText() const
Definition: qtpropertybrowser.cpp:283
QtBrowserItemPrivate(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent)
Definition: qtpropertybrowser.cpp:1075
virtual QIcon valueIcon(const QtProperty *property) const
Definition: qtpropertybrowser.cpp:694
QtBrowserItem * insertProperty(QtProperty *property, QtProperty *afterProperty)
Definition: qtpropertybrowser.cpp:1795
void propertyDestroyed(QtProperty *property)
virtual QString displayText(const QtProperty *property) const
Definition: qtpropertybrowser.cpp:722
void setToolTip(const QString &text)
Definition: qtpropertybrowser.cpp:304
~QtAbstractPropertyBrowser() override
Definition: qtpropertybrowser.cpp:1686
~QtBrowserItem()
Definition: qtpropertybrowser.cpp:1179
QList< QtBrowserItem * > m_children
Definition: qtpropertybrowser.cpp:1087
QtProperty * m_property
Definition: qtpropertybrowser.cpp:1082
void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty)
Definition: qtpropertybrowser.cpp:1440
QtProperty * property() const
Definition: qtpropertybrowser.cpp:1132
The QtAbstractEditorFactory is the base template class for editor factories.
Definition: qtpropertybrowser.h:207
void clear() const
Definition: qtpropertybrowser.cpp:656
QList< QtProperty * > m_subItems
Definition: qtpropertybrowser.cpp:1215
QMap< QtProperty *, QList< QtBrowserItem * > > m_propertyToIndexes
Definition: qtpropertybrowser.cpp:1221
virtual void itemChanged(QtBrowserItem *item)=0
QString m_statusTip
Definition: qtpropertybrowser.cpp:104
QtBrowserItem * currentItem() const
Definition: qtpropertybrowser.cpp:1954
QList< QtBrowserItem * > items(QtProperty *property) const
Definition: qtpropertybrowser.cpp:1716
void slotPropertyInserted(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty)
Definition: qtpropertybrowser.cpp:1430
void insertSubProperty(QtProperty *property, QtProperty *afterProperty)
Definition: qtpropertybrowser.cpp:414
QList< QtProperty * > m_subItems
Definition: qtpropertybrowser.cpp:101
bool isModified() const
Definition: qtpropertybrowser.cpp:250
QtBrowserItem * m_parent
Definition: qtpropertybrowser.cpp:1083
void removeProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1838
QtBrowserItem * q_ptr
Definition: qtpropertybrowser.cpp:1085
void propertyChanged(QtProperty *property)
virtual void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem)=0
QtAbstractEditorFactoryBase(QObject *parent=nullptr)
Definition: qtpropertybrowser.h:196
QMap< QtAbstractPropertyManager *, QList< QtProperty * > > m_managerToProperties
Definition: qtpropertybrowser.cpp:1216
bool m_modified
Definition: qtpropertybrowser.cpp:108
void slotPropertyDestroyed(QtProperty *property)
Definition: qtpropertybrowser.cpp:1450
QMap< QtAbstractPropertyManager *, QMap< QtAbstractEditorFactoryBase *, QList< QtAbstractPropertyBrowser * > > > Map2
Definition: qtpropertybrowser.cpp:1189
void currentItemChanged(QtBrowserItem *)
QString m_toolTip
Definition: qtpropertybrowser.cpp:103
Definition: qtpropertybrowser.cpp:1073
void breakConnection(QtAbstractPropertyManager *manager) override
Definition: qtpropertybrowser.h:268
QIcon valueIcon() const
Definition: qtpropertybrowser.cpp:271
The QtAbstractPropertyManager provides an interface for property managers.
Definition: qtpropertybrowser.h:153
Definition: qtpropertybrowser.cpp:76
QtAbstractPropertyBrowserPrivate * d_ptr
Definition: qtpropertybrowser.h:352
void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty)
Definition: qtpropertybrowser.cpp:1306
void setModified(bool modified)
Definition: qtpropertybrowser.cpp:376
PropertyManager * propertyManager(QtProperty *property) const
Definition: qtpropertybrowser.h:241
virtual void connectPropertyManager(PropertyManager *manager)=0
Definition: qtpropertybrowser.cpp:55
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)
Definition: qtpropertybrowser.cpp:1880
void removePropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:229
QList< QtProperty * > properties() const
Definition: qtpropertybrowser.cpp:1703
QList< QtBrowserItem * > children() const
Definition: qtpropertybrowser.cpp:1162
QtPropertyPrivate * d_ptr
Definition: qtpropertybrowser.h:148
virtual void disconnectPropertyManager(PropertyManager *manager)=0
QString displayText() const
Definition: qtpropertybrowser.cpp:295
void setPropertyName(const QString &text)
Definition: qtpropertybrowser.cpp:348
QSet< PropertyManager * > propertyManagers() const
Definition: qtpropertybrowser.h:238
QString m_name
Definition: qtpropertybrowser.cpp:106
bool m_enabled
Definition: qtpropertybrowser.cpp:107
QtAbstractPropertyManager * propertyManager() const
Definition: qtpropertybrowser.cpp:196
void propertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after)
~QtAbstractPropertyManager() override
Definition: qtpropertybrowser.cpp:646
virtual void uninitializeProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:799
void propertyChanged()
Definition: qtpropertybrowser.cpp:491
QtBrowserItem * createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex)
Definition: qtpropertybrowser.cpp:1347
virtual void initializeProperty(QtProperty *property)=0
virtual QString valueText(const QtProperty *property) const
Definition: qtpropertybrowser.cpp:708
void clear()
Definition: qtpropertybrowser.cpp:1749
QString toolTip() const
Definition: qtpropertybrowser.cpp:205
void addSubProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:393
QtAbstractPropertyManager *const m_manager
Definition: qtpropertybrowser.cpp:110
QList< QtBrowserItem * > topLevelItems() const
Definition: qtpropertybrowser.cpp:1739
QSet< QtProperty * > properties() const
Definition: qtpropertybrowser.cpp:669
void insertSubTree(QtProperty *property, QtProperty *parentProperty)
Definition: qtpropertybrowser.cpp:1229
QtProperty * q_ptr
Definition: qtpropertybrowser.cpp:98
void removeSubProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:468
virtual void itemRemoved(QtBrowserItem *item)=0
QString propertyName() const
Definition: qtpropertybrowser.cpp:232
void slotPropertyDataChanged(QtProperty *property)
Definition: qtpropertybrowser.cpp:1457