5#ifndef PROPERTYEDITOR_H
6#define PROPERTYEDITOR_H
9#include <qdesigner_propertyeditor_p.h>
11#include <QtCore/qlist.h>
12#include <QtCore/qmap.h>
13#include <QtCore/qpointer.h>
14#include <QtCore/qset.h>
49 void setPropertyValue(
const QString &name,
const QVariant &value,
bool changed =
true)
override;
63 bool event(QEvent *event)
override;
67 void slotValueChanged(
QtProperty *property,
const QVariant &value,
bool enableSubPropertyHandling);
68 void slotViewTriggered(QAction *action);
69 void slotAddDynamicProperty(QAction *action);
70 void slotRemoveDynamicProperty();
71 void slotSorting(
bool sort);
72 void slotColoring(
bool color);
74 void setFilter(
const QString &pattern);
78 void updateToolBarLabel();
79 int toBrowserType(
const QVariant &value,
const QString &propertyName)
const;
80 QString removeScope(
const QString &value)
const;
84 QString realClassName(QObject *object)
const;
85 void storeExpansionState();
86 void applyExpansionState();
87 void storePropertiesExpansionState(
const QList<QtBrowserItem *> &items);
88 void applyPropertiesExpansionState(
const QList<QtBrowserItem *> &items);
90 int applyPropertiesFilter(
const QList<QtBrowserItem *> &items);
100 void updateForegroundBrightness();
101 QColor propertyColor(
QtProperty *property)
const;
102 void updateActionsState();
104 void saveSettings()
const;
105 void editProperty(
const QString &name);
110 QSet<QString> m_alignmentProperties;
111 const QString m_fontProperty;
112 const QString m_qLayoutWidget;
113 const QString m_designerPrefix;
114 const QString m_layout;
115 const QString m_validationModeAttribute;
116 const QString m_fontAttribute;
117 const QString m_superPaletteAttribute;
118 const QString m_enumNamesAttribute;
119 const QString m_resettableAttribute;
120 const QString m_flagsAttribute;
123 const Strings m_strings;
124 QDesignerFormEditorInterface *m_core;
132 QPointer<QObject> m_object;
133 QMap<QString, QtVariantProperty*> m_nameToProperty;
134 QHash<QtProperty *, QString> m_propertyToGroup;
135 QMap<QString, QtVariantProperty*> m_nameToGroup;
136 QList<QtProperty *> m_groups;
138 QString m_recentlyAddedDynamicProperty;
139 bool m_updatingBrowser =
false;
141 QStackedWidget *m_stackedWidget;
142 QLineEdit *m_filterWidget;
143 int m_buttonIndex = -1;
144 int m_treeIndex = -1;
145 QAction *m_addDynamicAction;
146 QAction *m_removeDynamicAction;
147 QAction *m_sortingAction;
148 QAction *m_coloringAction;
149 QAction *m_treeAction;
150 QAction *m_buttonAction;
153 bool m_sorting =
false;
154 bool m_coloring =
false;
156 QMap<QString,
bool> m_expansionState;
158 QString m_filterPattern;
159 QList<std::pair<QColor, QColor> > m_colors;
160 std::pair<QColor, QColor> m_dynamicColor;
161 std::pair<QColor, QColor> m_layoutColor;
163 bool m_brightness =
false;
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
The QtBrowserItem class represents a property in a property browser instance.
The QtProperty class encapsulates an instance of a property.
The QtTreePropertyBrowser class provides QTreeWidget based property browser.
The QtVariantProperty class is a convenience class handling QVariant based properties.
void reloadResourceProperties() override
QString currentPropertyName() const override
Returns the name of the currently selected property in the property editor.
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
~PropertyEditor() override
QDesignerFormEditorInterface * core() const override
Returns a pointer to \QD's current QDesignerFormEditorInterface object.
void setObject(QObject *object) override
Changes the currently selected object in \QD's workspace, to object.
QObject * object() const override
Returns the currently selected object in \QD's workspace.
void setReadOnly(bool readOnly) override
If readOnly is true, the property editor is made write protected; otherwise the write protection is r...
bool isReadOnly() const override
Returns true if the property editor is write protected; otherwise false.
void updatePropertySheet() override
void setPropertyValue(const QString &name, const QVariant &value, bool changed=true) override
Sets the value of the property specified by name to value.
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QT_PROPERTYEDITOR_EXPORT
static int qtMajorVersion(int qtVersion)
static QString widgetBoxFileName(int qtVersion, const QDesignerLanguageExtension *lang=nullptr)
static void setMinorVersion(int minorVersion, int *qtVersion)
static int qtMinorVersion(int qtVersion)
#define QDESIGNER_SHARED_EXPORT