4#ifndef PROPERTYEDITOR_H
5#define PROPERTYEDITOR_H
8#include <qdesigner_propertyeditor_p.h>
10#include <QtCore/qlist.h>
11#include <QtCore/qmap.h>
12#include <QtCore/qpointer.h>
13#include <QtCore/qset.h>
48 void setPropertyValue(
const QString &name,
const QVariant &value,
bool changed =
true)
override;
62 bool event(QEvent *event)
override;
66 void slotValueChanged(
QtProperty *property,
const QVariant &value,
bool enableSubPropertyHandling);
67 void slotViewTriggered(QAction *action);
68 void slotAddDynamicProperty(QAction *action);
69 void slotRemoveDynamicProperty();
70 void slotSorting(
bool sort);
71 void slotColoring(
bool color);
73 void setFilter(
const QString &pattern);
77 void updateToolBarLabel();
78 int toBrowserType(
const QVariant &value,
const QString &propertyName)
const;
79 QString removeScope(
const QString &value)
const;
83 QString realClassName(QObject *object)
const;
84 void storeExpansionState();
85 void applyExpansionState();
86 void storePropertiesExpansionState(
const QList<QtBrowserItem *> &items);
87 void applyPropertiesExpansionState(
const QList<QtBrowserItem *> &items);
89 int applyPropertiesFilter(
const QList<QtBrowserItem *> &items);
99 void updateForegroundBrightness();
100 QColor propertyColor(
QtProperty *property)
const;
101 void updateActionsState();
103 void saveSettings()
const;
104 void editProperty(
const QString &name);
109 QSet<QString> m_alignmentProperties;
110 const QString m_fontProperty;
111 const QString m_qLayoutWidget;
112 const QString m_designerPrefix;
113 const QString m_layout;
114 const QString m_validationModeAttribute;
115 const QString m_fontAttribute;
116 const QString m_superPaletteAttribute;
117 const QString m_enumNamesAttribute;
118 const QString m_resettableAttribute;
119 const QString m_flagsAttribute;
122 const Strings m_strings;
123 QDesignerFormEditorInterface *m_core;
131 QPointer<QObject> m_object;
132 QMap<QString, QtVariantProperty*> m_nameToProperty;
133 QHash<QtProperty *, QString> m_propertyToGroup;
134 QMap<QString, QtVariantProperty*> m_nameToGroup;
135 QList<QtProperty *> m_groups;
137 QString m_recentlyAddedDynamicProperty;
138 bool m_updatingBrowser =
false;
140 QStackedWidget *m_stackedWidget;
141 QLineEdit *m_filterWidget;
142 int m_buttonIndex = -1;
143 int m_treeIndex = -1;
144 QAction *m_addDynamicAction;
145 QAction *m_removeDynamicAction;
146 QAction *m_sortingAction;
147 QAction *m_coloringAction;
148 QAction *m_treeAction;
149 QAction *m_buttonAction;
152 bool m_sorting =
false;
153 bool m_coloring =
false;
155 QMap<QString,
bool> m_expansionState;
157 QString m_filterPattern;
159 std::pair<QColor, QColor> m_dynamicColor;
160 std::pair<QColor, QColor> m_layoutColor;
162 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
#define INIT_PLUGIN_INSTANCE(PLUGIN)
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