Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
designerpropertymanager.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef DESIGNERPROPERTYMANAGER_H
5#define DESIGNERPROPERTYMANAGER_H
6
10
11#include <qdesigner_utils_p.h>
12#include <shared_enums_p.h>
13
14#include <QtCore/qurl.h>
15#include <QtCore/qhash.h>
16#include <QtGui/qfont.h>
17#include <QtGui/qicon.h>
18
20
21using DesignerIntPair = std::pair<QString, uint>;
22using DesignerFlagList = QList<DesignerIntPair>;
23
24class QComboBox;
25class QDesignerFormEditorInterface;
26class QLineEdit;
27class QUrl;
28class QKeySequenceEdit;
29
30namespace qdesigner_internal
31{
32
33class ResetWidget;
34
35class TextEditor;
37class PixmapEditor;
39class FormWindowBase;
40
41class ResetDecorator : public QObject
42{
44public:
47
49 QWidget *editor(QWidget *subEditor, bool resettable, QtAbstractPropertyManager *manager, QtProperty *property,
50 QWidget *parent);
52 void setSpacing(int spacing);
55private slots:
57 void slotEditorDestroyed(QObject *object);
58private:
59 QHash<const QtProperty *, QList<ResetWidget *>> m_createdResetWidgets;
60 QHash<ResetWidget *, QtProperty *> m_resetWidgetToProperty;
61 int m_spacing;
62 const QDesignerFormEditorInterface *m_core;
63};
64
65// Helper for handling sub-properties of properties inheriting PropertySheetTranslatableData
66// (translatable, disambiguation, comment).
67template <class PropertySheetValue>
69{
70public:
71 void initialize(QtVariantPropertyManager *m, QtProperty *property, const PropertySheetValue &value);
72 bool uninitialize(QtProperty *property);
73 bool destroy(QtProperty *subProperty);
74
75 bool value(const QtProperty *property, QVariant *rc) const;
77 const QVariant &value);
78
80 int expectedTypeId, const QVariant &value);
81
82private:
83 QHash<const QtProperty *, PropertySheetValue> m_values;
84 QHash<const QtProperty *, QtProperty *> m_valueToComment;
85 QHash<const QtProperty *, QtProperty *> m_valueToTranslatable;
86 QHash<const QtProperty *, QtProperty *> m_valueToDisambiguation;
87 QHash<const QtProperty *, QtProperty *> m_valueToId;
88
89 QHash<const QtProperty *, QtProperty *> m_commentToValue;
90 QHash<const QtProperty *, QtProperty *> m_translatableToValue;
91 QHash<const QtProperty *, QtProperty *> m_disambiguationToValue;
92 QHash<const QtProperty *, QtProperty *> m_idToValue;
93};
94
96{
98public:
100
101 explicit DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = nullptr);
103
104 QStringList attributes(int propertyType) const override;
105 int attributeType(int propertyType, const QString &attribute) const override;
106
107 QVariant attributeValue(const QtProperty *property, const QString &attribute) const override;
108 bool isPropertyTypeSupported(int propertyType) const override;
109 QVariant value(const QtProperty *property) const override;
110 int valueType(int propertyType) const override;
111 QString valueText(const QtProperty *property) const override;
112 QIcon valueIcon(const QtProperty *property) const override;
113
115 bool resetFontSubProperty(QtProperty *property);
116 bool resetIconSubProperty(QtProperty *subProperty);
117
119
120 static int designerFlagTypeId();
121 static int designerFlagListTypeId();
122 static int designerAlignmentTypeId();
123 static int designerPixmapTypeId();
124 static int designerIconTypeId();
125 static int designerStringTypeId();
126 static int designerStringListTypeId();
127 static int designerKeySequenceTypeId();
128
129 void setObject(QObject *object) { m_object = object; }
130
131 static void setUseIdBasedTranslations(bool v)
132 { m_IdBasedTranslations = v; }
134 { return m_IdBasedTranslations; }
135
136 static QString alignDefaultAttribute();
137
138 static uint alignDefault(const QtVariantProperty *prop);
139
140public Q_SLOTS:
142 void setValue(QtProperty *property, const QVariant &value) override;
144 // sourceOfChange - a subproperty (or just property) which caused a change
145 //void valueChanged(QtProperty *property, const QVariant &value, QtProperty *sourceOfChange);
147protected:
148 void initializeProperty(QtProperty *property) override;
149 void uninitializeProperty(QtProperty *property) override;
150private Q_SLOTS:
152 void slotPropertyDestroyed(QtProperty *property);
153private:
154 void createIconSubProperty(QtProperty *iconProperty, QIcon::Mode mode, QIcon::State state, const QString &subName);
155
156 QHash<const QtProperty *, bool> m_resetMap;
157
158 struct FlagData
159 {
160 uint val{0};
161 DesignerFlagList flags;
162 QList<uint> values;
163 };
164
165 QHash<const QtProperty *, FlagData> m_flagValues;
166 QHash<const QtProperty *, QList<QtProperty *>> m_propertyToFlags;
167 QHash<const QtProperty *, QtProperty *> m_flagToProperty;
168
169 int alignToIndexH(uint align) const;
170 int alignToIndexV(uint align) const;
171 uint indexHToAlign(int idx) const;
172 uint indexVToAlign(int idx) const;
173 QString indexHToString(int idx) const;
174 QString indexVToString(int idx) const;
175 QHash<const QtProperty *, uint> m_alignValues;
177 PropertyToPropertyMap m_propertyToAlignH;
178 PropertyToPropertyMap m_propertyToAlignV;
179 PropertyToPropertyMap m_alignHToProperty;
180 PropertyToPropertyMap m_alignVToProperty;
181 QHash<const QtProperty *, Qt::Alignment> m_alignDefault;
182
183 QHash<const QtProperty *, QMap<std::pair<QIcon::Mode, QIcon::State>, QtProperty *>> m_propertyToIconSubProperties;
184 QHash<const QtProperty *, std::pair<QIcon::Mode, QIcon::State>> m_iconSubPropertyToState;
185 PropertyToPropertyMap m_iconSubPropertyToProperty;
186 PropertyToPropertyMap m_propertyToTheme;
187 PropertyToPropertyMap m_propertyToThemeEnum;
188
189 TranslatablePropertyManager<PropertySheetStringValue> m_stringManager;
190 TranslatablePropertyManager<PropertySheetKeySequenceValue> m_keySequenceManager;
191 TranslatablePropertyManager<PropertySheetStringListValue> m_stringListManager;
192
193 struct PaletteData
194 {
195 QPalette val;
196 QPalette superPalette;
197 };
198 QHash<const QtProperty *, PaletteData> m_paletteValues;
199
200 QHash<const QtProperty *, qdesigner_internal::PropertySheetPixmapValue> m_pixmapValues;
201 QHash<const QtProperty *, qdesigner_internal::PropertySheetIconValue> m_iconValues;
202
203 QHash<const QtProperty *, int> m_intValues;
204 QHash<const QtProperty *, uint> m_uintValues;
205 QHash<const QtProperty *, qlonglong> m_longLongValues;
206 QHash<const QtProperty *, qulonglong> m_uLongLongValues;
207 QHash<const QtProperty *, QUrl> m_urlValues;
208 QHash<const QtProperty *, QByteArray> m_byteArrayValues;
209
210 QHash<const QtProperty *, int> m_stringAttributes;
211 QHash<const QtProperty *, QFont> m_stringFontAttributes;
212 QHash<const QtProperty *, bool> m_stringThemeAttributes;
213 QHash<const QtProperty *, bool> m_intThemeEnumAttributes;
214
215 BrushPropertyManager m_brushManager;
216 FontPropertyManager m_fontManager;
217
218 QHash<const QtProperty *, QPixmap> m_defaultPixmaps;
219 QHash<const QtProperty *, QIcon> m_defaultIcons;
220
221 bool m_changingSubValue;
222 QDesignerFormEditorInterface *m_core;
223
224 QObject *m_object;
225
226 QtProperty *m_sourceOfChange;
227 static bool m_IdBasedTranslations;
228};
229
231{
233public:
236 void setSpacing(int spacing);
237 void setFormWindowBase(FormWindowBase *fwb);
238signals:
240protected:
243 QWidget *parent) override;
245private slots:
247 void slotAttributeChanged(QtProperty *property, const QString &attribute, const QVariant &value);
248 void slotPropertyChanged(QtProperty *property);
249 void slotValueChanged(QtProperty *property, const QVariant &value);
250 void slotStringTextChanged(const QString &value);
251 void slotKeySequenceChanged(const QKeySequence &value);
252 void slotPaletteChanged(const QPalette &value);
253 void slotPixmapChanged(const QString &value);
254 void slotIconChanged(const QString &value);
255 void slotIconThemeChanged(const QString &value);
256 void slotIconThemeEnumChanged(int value);
257 void slotUintChanged(const QString &value);
258 void slotIntChanged(int);
259 void slotLongLongChanged(const QString &value);
260 void slotULongLongChanged(const QString &value);
261 void slotUrlChanged(const QString &value);
262 void slotByteArrayChanged(const QString &value);
263 void slotStringListChanged(const QStringList &value);
264private:
265 TextEditor *createTextEditor(QWidget *parent, TextPropertyValidationMode vm, const QString &value);
266
267 ResetDecorator *m_resetDecorator;
268 bool m_changingPropertyValue = false;
269 QDesignerFormEditorInterface *m_core;
270 FormWindowBase *m_fwb = nullptr;
271
272 int m_spacing = -1;
273
274 QHash<const QtProperty *, QList<TextEditor *>> m_stringPropertyToEditors;
275 QHash<TextEditor *, QtProperty *> m_editorToStringProperty;
276 QHash<const QtProperty *, QList<QKeySequenceEdit *>> m_keySequencePropertyToEditors;
277 QHash<QKeySequenceEdit *, QtProperty *> m_editorToKeySequenceProperty;
278 QHash<const QtProperty *, QList<PaletteEditorButton *>> m_palettePropertyToEditors;
279 QHash<PaletteEditorButton *, QtProperty *> m_editorToPaletteProperty;
280 QHash<const QtProperty *, QList<PixmapEditor *>> m_pixmapPropertyToEditors;
281 QHash<PixmapEditor *, QtProperty *> m_editorToPixmapProperty;
282 QHash<const QtProperty *, QList<PixmapEditor *>> m_iconPropertyToEditors;
283 QHash<PixmapEditor *, QtProperty *> m_editorToIconProperty;
284 QHash<const QtProperty *, QList<QComboBox *>> m_intPropertyToComboEditors;
285 QHash<QComboBox *, QtProperty *> m_comboEditorToIntProperty;
286 QHash<const QtProperty *, QList<QLineEdit *>> m_uintPropertyToEditors;
287 QHash<QLineEdit *, QtProperty *> m_editorToUintProperty;
288 QHash<const QtProperty *, QList<QLineEdit *>> m_longLongPropertyToEditors;
289 QHash<QLineEdit *, QtProperty *> m_editorToLongLongProperty;
290 QHash<const QtProperty *, QList<QLineEdit *>> m_uLongLongPropertyToEditors;
291 QHash<QLineEdit *, QtProperty *> m_editorToULongLongProperty;
292 QHash<const QtProperty *, QList<TextEditor *>> m_urlPropertyToEditors;
293 QHash<TextEditor *, QtProperty *> m_editorToUrlProperty;
294 QHash<const QtProperty *, QList<TextEditor *>> m_byteArrayPropertyToEditors;
295 QHash<TextEditor *, QtProperty *> m_editorToByteArrayProperty;
296 QHash<const QtProperty *, QList<StringListEditorButton *>> m_stringListPropertyToEditors;
297 QHash<StringListEditorButton *, QtProperty *> m_editorToStringListProperty;
298};
299
300} // namespace qdesigner_internal
301
302QT_END_NAMESPACE
303
304Q_DECLARE_METATYPE(DesignerIntPair)
305Q_DECLARE_METATYPE(DesignerFlagList)
306
307#endif
static const char * brushStyles[]
The QtAbstractEditorFactoryBase provides an interface for editor factories.
virtual void breakConnection(QtAbstractPropertyManager *manager)=0
The QtAbstractEditorFactory is the base template class for editor factories.
void removePropertyManager(PropertyManager *manager)
Removes the given manager from this factory's set of managers.
virtual void disconnectPropertyManager(PropertyManager *manager)=0
Disconnects this factory from the given manager's signals.
void breakConnection(QtAbstractPropertyManager *manager) override
PropertyManager * propertyManager(QtProperty *property) const
Returns the property manager for the given property, or 0 if the given property doesn't belong to any...
QSet< PropertyManager * > propertyManagers() const
Returns the factory's set of associated managers.
void addPropertyManager(PropertyManager *manager)
Adds the given manager to this factory's set of managers, making this factory produce editing widgets...
virtual void connectPropertyManager(PropertyManager *manager)=0
Connects this factory to the given manager's signals.
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
QtBrowserItem * currentItem() const
Returns the current item in the property browser.
QList< QtBrowserItem * > items(QtProperty *property) const
Returns the property browser's list of all items associated with the given property.
virtual void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem)=0
This function is called to update the widget whenever a property is inserted or added to the property...
QList< QtBrowserItem * > topLevelItems() const
Returns the list of top-level items.
QList< QtProperty * > properties() const
Returns the property browser's list of top level properties.
QtBrowserItem * topLevelItem(QtProperty *property) const
Returns the top-level items associated with the given property.
void removeProperty(QtProperty *property)
Removes the specified property (and its subproperties) from the property browser's list of top level ...
void unsetFactoryForManager(QtAbstractPropertyManager *manager)
Removes the association between the given manager and the factory bound to it, automatically calling ...
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Connects the given manager to the given factory, ensuring that properties of the manager's type will ...
virtual void itemRemoved(QtBrowserItem *item)=0
This function is called to update the widget whenever a property is removed from the property browser...
virtual void itemChanged(QtBrowserItem *item)=0
This function is called whenever a property's data changes, passing a pointer to the item of property...
QtBrowserItem * insertProperty(QtProperty *property, QtProperty *afterProperty)
Inserts the given property (and its subproperties) after the specified afterProperty in the browser's...
void setCurrentItem(QtBrowserItem *)
Sets the current item in the property browser to item.
~QtAbstractPropertyBrowser()
Destroys the property browser, and destroys all the items that were created by this property browser.
void clear()
Removes all the properties from the editor, but does not delete them since they can still be used in ...
The QtAbstractPropertyManager provides an interface for property managers.
virtual void initializeProperty(QtProperty *property)=0
This function is called whenever a new valid property pointer has been created, passing the pointer a...
void propertyDestroyed(QtProperty *property)
This signal is emitted when the specified property is about to be destroyed.
virtual QIcon valueIcon(const QtProperty *property) const
Returns an icon representing the current state of the given property.
void propertyChanged(QtProperty *property)
This signal is emitted whenever a property's data changes, passing a pointer to the property as param...
QSet< QtProperty * > properties() const
Returns the set of properties created by this manager.
~QtAbstractPropertyManager()
Destroys the manager.
virtual bool hasValue(const QtProperty *property) const
Returns whether the given property has a value.
QtProperty * addProperty(const QString &name=QString())
Creates a property with the given name which then is owned by this manager.
virtual QtProperty * createProperty()
Creates a property.
void clear() const
Destroys all the properties that this manager has created.
virtual QString valueText(const QtProperty *property) const
Returns a string representing the current state of the given property.
virtual void uninitializeProperty(QtProperty *property)
This function is called just before the specified property is destroyed.
void propertyRemoved(QtProperty *property, QtProperty *parent)
This signal is emitted when a subproperty is removed, passing pointers to the removed property and th...
The QtBoolPropertyManager class provides and manages boolean properties.
QIcon valueIcon(const QtProperty *property) const override
\reimp
bool value(const QtProperty *property) const
Returns the given property's value.
~QtBoolPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
The QtBrowserItem class represents a property in a property browser instance.
QtProperty * property() const
Returns the property which is accosiated with this item.
QtAbstractPropertyBrowser * browser() const
Returns the property browser which owns this item.
QList< QtBrowserItem * > children() const
Returns the children items of this item.
QtBrowserItem * parent() const
Returns the parent item of this item.
The QtCharPropertyManager provides and manages QChar properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QChar value(const QtProperty *property) const
Returns the given property's value.
~QtCharPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
The QtColorPropertyManager provides and manages QColor properties.
~QtColorPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that produces the nested red, green and blue subproperties.
QColor value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
The QtCursorPropertyManager provides and manages QCursor properties.
QString valueText(const QtProperty *property) const override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
~QtCursorPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
QCursor value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
The QtDatePropertyManager provides and manages QDate properties.
void rangeChanged(QtProperty *property, QDate minVal, QDate maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid dates,...
void setMaximum(QtProperty *property, QDate maxVal)
Sets the maximum value for the given property to maxVal.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void setMinimum(QtProperty *property, QDate minVal)
Sets the minimum value for the given property to minVal.
~QtDatePropertyManager()
Destroys this manager, and all the properties it has created.
void setRange(QtProperty *property, QDate minVal, QDate maxVal)
Sets the range of valid dates.
QDate minimum(const QtProperty *property) const
Returns the given property's minimum date.
QDate maximum(const QtProperty *property) const
Returns the given property's maximum date.
QDate value(const QtProperty *property) const
Returns the given property's value.
The QtDateTimePropertyManager provides and manages QDateTime properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QDateTime value(const QtProperty *property) const
Returns the given property's value.
~QtDateTimePropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
The QtDoublePropertyManager provides and manages double properties.
QString valueText(const QtProperty *property) const override
\reimp
double singleStep(const QtProperty *property) const
Returns the given property's step value.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void singleStepChanged(QtProperty *property, double step)
This signal is emitted whenever a property created by this manager changes its single step property,...
void setMaximum(QtProperty *property, double maxVal)
Sets the maximum value for the given property to maxVal.
void uninitializeProperty(QtProperty *property) override
\reimp
void decimalsChanged(QtProperty *property, int prec)
This signal is emitted whenever a property created by this manager changes its precision of value,...
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
double minimum(const QtProperty *property) const
Returns the given property's minimum value.
~QtDoublePropertyManager()
Destroys this manager, and all the properties it has created.
double value(const QtProperty *property) const
Returns the given property's value.
void setSingleStep(QtProperty *property, double step)
Sets the step value for the given property to step.
void initializeProperty(QtProperty *property) override
\reimp
void setMinimum(QtProperty *property, double minVal)
Sets the minimum value for the given property to minVal.
void rangeChanged(QtProperty *property, double minVal, double maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid values,...
double maximum(const QtProperty *property) const
Returns the given property's maximum value.
void setRange(QtProperty *property, double minVal, double maxVal)
Sets the range of valid values.
The QtEnumPropertyManager provides and manages enum properties.
void setEnumIcons(QtProperty *property, const QMap< int, QIcon > &icons)
Sets the given property's map of enum values to their icons to enumIcons.
QMap< int, QIcon > enumIcons(const QtProperty *property) const
Returns the given property's map of enum values to their icons.
void enumIconsChanged(QtProperty *property, const QMap< int, QIcon > &icons)
This signal is emitted whenever a property created by this manager changes its enum icons,...
void enumNamesChanged(QtProperty *property, const QStringList &names)
This signal is emitted whenever a property created by this manager changes its enum names,...
QStringList enumNames(const QtProperty *property) const
Returns the given property's list of enum names.
QString valueText(const QtProperty *property) const override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
void setEnumNames(QtProperty *property, const QStringList &names)
Sets the given property's list of enum names to enumNames.
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
~QtEnumPropertyManager()
Destroys this manager, and all the properties it has created.
int value(const QtProperty *property) const
Returns the given property's value which is an index in the list returned by enumNames()
The QtFlagPropertyManager provides and manages flag properties.
~QtFlagPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
void flagNamesChanged(QtProperty *property, const QStringList &names)
This signal is emitted whenever a property created by this manager changes its flag names,...
QString valueText(const QtProperty *property) const override
\reimp
QtBoolPropertyManager * subBoolPropertyManager() const
Returns the manager that produces the nested boolean subproperties representing each flag.
void setFlagNames(QtProperty *property, const QStringList &names)
Sets the given property's list of flag names to flagNames.
void initializeProperty(QtProperty *property) override
\reimp
QStringList flagNames(const QtProperty *property) const
Returns the given property's list of flag names.
int value(const QtProperty *property) const
Returns the given property's value.
The QtFontPropertyManager provides and manages QFont properties.
void uninitializeProperty(QtProperty *property) override
\reimp
QFont value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
QtBoolPropertyManager * subBoolPropertyManager() const
Returns the manager that creates the bold, italic, underline, strikeOut and kerning subproperties.
QIcon valueIcon(const QtProperty *property) const override
\reimp
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that create the family subproperty.
QString valueText(const QtProperty *property) const override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the pointSize subproperty.
~QtFontPropertyManager()
Destroys this manager, and all the properties it has created.
The QtGroupPropertyManager provides and manages group properties.
bool hasValue(const QtProperty *property) const override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
~QtGroupPropertyManager()
Destroys this manager, and all the properties it has created.
The QtIntPropertyManager provides and manages int properties.
void uninitializeProperty(QtProperty *property) override
\reimp
~QtIntPropertyManager()
Destroys this manager, and all the properties it has created.
void rangeChanged(QtProperty *property, int minVal, int maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid values,...
void setRange(QtProperty *property, int minVal, int maxVal)
Sets the range of valid values.
void singleStepChanged(QtProperty *property, int step)
This signal is emitted whenever a property created by this manager changes its single step property,...
int singleStep(const QtProperty *property) const
Returns the given property's step value.
int minimum(const QtProperty *property) const
Returns the given property's minimum value.
QString valueText(const QtProperty *property) const override
\reimp
int value(const QtProperty *property) const
Returns the given property's value.
void setMaximum(QtProperty *property, int maxVal)
Sets the maximum value for the given property to maxVal.
void setMinimum(QtProperty *property, int minVal)
Sets the minimum value for the given property to minVal.
int maximum(const QtProperty *property) const
Returns the given property's maximum value.
void setSingleStep(QtProperty *property, int step)
Sets the step value for the given property to step.
void initializeProperty(QtProperty *property) override
\reimp
The QtKeySequencePropertyManager provides and manages QKeySequence properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QKeySequence value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
~QtKeySequencePropertyManager()
Destroys this manager, and all the properties it has created.
The QtLocalePropertyManager provides and manages QLocale properties.
void uninitializeProperty(QtProperty *property) override
\reimp
~QtLocalePropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that creates the nested language and territory subproperties.
void initializeProperty(QtProperty *property) override
\reimp
QLocale value(const QtProperty *property) const
Returns the given property's value.
The QtPointFPropertyManager provides and manages QPointF properties.
void initializeProperty(QtProperty *property) override
\reimp
void decimalsChanged(QtProperty *property, int prec)
This signal is emitted whenever a property created by this manager changes its precision of value,...
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QPointF value(const QtProperty *property) const
Returns the given property's value.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested x and y subproperties.
~QtPointFPropertyManager()
Destroys this manager, and all the properties it has created.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
The QtPointPropertyManager provides and manages QPoint properties.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested x and y subproperties.
~QtPointPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QPoint value(const QtProperty *property) const
Returns the given property's value.
The QtProperty class encapsulates an instance of a property.
void setModified(bool modified)
Sets the property's modified state according to the passed modified value.
void setToolTip(const QString &text)
void addSubProperty(QtProperty *property)
Appends the given property to this property's subproperties.
QString propertyName() const
Returns the property's name.
bool isEnabled() const
Returns whether the property is enabled.
void setEnabled(bool enable)
Enables or disables the property according to the passed enable value.
QString toolTip() const
bool hasValue() const
Returns whether the property has a value.
void insertSubProperty(QtProperty *property, QtProperty *afterProperty)
Inserts the given property after the specified precedingProperty into this property's list of subprop...
QList< QtProperty * > subProperties() const
Returns the set of subproperties.
QString whatsThis() const
Returns the property's "What's This" help text.
void removeSubProperty(QtProperty *property)
Removes the given property from the list of subproperties without deleting it.
void setValueToolTip(const QString &text)
Sets the property value's tool tip to the given text.
QString statusTip() const
Returns the property's status tip.
QIcon valueIcon() const
Returns an icon representing the current state of this property.
bool isModified() const
Returns whether the property is modified.
virtual ~QtProperty()
Destroys this property.
void setPropertyName(const QString &text)
Sets the property's name to the given name.
void setDescriptionToolTip(const QString &text)
Sets the property description's tool tip to the given text.
QString valueText() const
Returns a string representing the current state of this property.
QString valueToolTip() const
Returns the property value's tool tip.
void setStatusTip(const QString &text)
Sets the property's status tip to the given text.
QtProperty(QtAbstractPropertyManager *manager)
Creates a property with the given manager.
void setWhatsThis(const QString &text)
Sets the property's "What's This" help text to the given text.
QString descriptionToolTip() const
Returns the property description's tool tip.
QtAbstractPropertyManager * propertyManager() const
Returns a pointer to the manager that owns this property.
The QtRectFPropertyManager provides and manages QRectF properties.
void constraintChanged(QtProperty *property, const QRectF &constraint)
This signal is emitted whenever property changes its constraint rectangle, passing a pointer to the p...
QRectF constraint(const QtProperty *property) const
Returns the given property's constraining rectangle.
QRectF value(const QtProperty *property) const
Returns the given property's value.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested x, y, width and height subproperties.
void uninitializeProperty(QtProperty *property) override
\reimp
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void decimalsChanged(QtProperty *property, int prec)
This signal is emitted whenever a property created by this manager changes its precision of value,...
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
void setConstraint(QtProperty *property, const QRectF &constraint)
Sets the given property's constraining rectangle to constraint.
~QtRectFPropertyManager()
Destroys this manager, and all the properties it has created.
The QtRectPropertyManager provides and manages QRect properties.
QRect value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested x, y, width and height subproperties.
~QtRectPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
void constraintChanged(QtProperty *property, const QRect &constraint)
This signal is emitted whenever property changes its constraint rectangle, passing a pointer to the p...
QRect constraint(const QtProperty *property) const
Returns the given property's constraining rectangle.
void setConstraint(QtProperty *property, QRect constraint)
Sets the given property's constraining rectangle to constraint.
void uninitializeProperty(QtProperty *property) override
\reimp
The QtSizeFPropertyManager provides and manages QSizeF properties.
QSizeF value(const QtProperty *property) const
Returns the given property's value.
~QtSizeFPropertyManager()
Destroys this manager, and all the properties it has created.
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
QSizeF maximum(const QtProperty *property) const
Returns the given property's maximum size value.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QSizeF minimum(const QtProperty *property) const
Returns the given property's minimum size value.
void rangeChanged(QtProperty *property, QSizeF minVal, QSizeF maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid sizes,...
void setMinimum(QtProperty *property, QSizeF minVal)
Sets the minimum size value for the given property to minVal.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested width and height subproperties.
void uninitializeProperty(QtProperty *property) override
\reimp
void setRange(QtProperty *property, QSizeF minVal, QSizeF maxVal)
Sets the range of valid values.
void setMaximum(QtProperty *property, QSizeF maxVal)
Sets the maximum size value for the given property to maxVal.
void decimalsChanged(QtProperty *property, int prec)
This signal is emitted whenever a property created by this manager changes its precision of value,...
The QtSizePolicyPropertyManager provides and manages QSizePolicy properties.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested horizontalStretch and verticalStretch subproperties.
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that creates the nested horizontalPolicy and verticalPolicy subproperties.
~QtSizePolicyPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QSizePolicy value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
The QtSizePropertyManager provides and manages QSize properties.
void rangeChanged(QtProperty *property, QSize minVal, QSize maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid sizes,...
QSize value(const QtProperty *property) const
Returns the given property's value.
void uninitializeProperty(QtProperty *property) override
\reimp
void setMaximum(QtProperty *property, QSize maxVal)
Sets the maximum size value for the given property to maxVal.
void setRange(QtProperty *property, QSize minVal, QSize maxVal)
Sets the range of valid values.
void initializeProperty(QtProperty *property) override
\reimp
QSize maximum(const QtProperty *property) const
Returns the given property's maximum size value.
void setMinimum(QtProperty *property, QSize minVal)
Sets the minimum size value for the given property to minVal.
QString valueText(const QtProperty *property) const override
\reimp
QSize minimum(const QtProperty *property) const
Returns the given property's minimum size value.
~QtSizePropertyManager()
Destroys this manager, and all the properties it has created.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested width and height subproperties.
The QtStringPropertyManager provides and manages QString properties.
QString value(const QtProperty *property) const
Returns the given property's value.
QRegularExpression regExp(const QtProperty *property) const
Returns the given property's currently set regular expression.
void setRegExp(QtProperty *property, const QRegularExpression &regExp)
Sets the regular expression of the given property to regExp.
~QtStringPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
void regExpChanged(QtProperty *property, const QRegularExpression &regExp)
This signal is emitted whenever a property created by this manager changes its currenlty set regular ...
The QtTimePropertyManager provides and manages QTime properties.
void initializeProperty(QtProperty *property) override
\reimp
~QtTimePropertyManager()
Destroys this manager, and all the properties it has created.
QTime value(const QtProperty *property) const
Returns the given property's value.
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
The QtVariantEditorFactory class provides widgets for properties created by QtVariantPropertyManager ...
The QtVariantPropertyManager class provides and manages QVariant based properties.
QtVariantProperty * variantProperty(const QtProperty *property) const
Returns the given property converted into a QtVariantProperty.
The QtVariantProperty class is a convenience class handling QVariant based properties.
int valueChanged(QtVariantPropertyManager *vm, QtProperty *property, const QVariant &value)
bool valueIcon(const QtProperty *property, QIcon *icon) const
bool valueText(const QtProperty *property, QString *text) const
void initializeProperty(QtVariantPropertyManager *vm, QtProperty *property, int enumTypeId)
bool value(const QtProperty *property, QVariant *v) const
int setValue(QtVariantPropertyManager *vm, QtProperty *property, const QVariant &value)
void connectPropertyManager(QtVariantPropertyManager *manager) override
QWidget * createEditor(QtVariantPropertyManager *manager, QtProperty *property, QWidget *parent) override
void disconnectPropertyManager(QtVariantPropertyManager *manager) override
bool isPropertyTypeSupported(int propertyType) const override
Returns true if the given propertyType is supported by this variant manager; otherwise false.
void uninitializeProperty(QtProperty *property) override
This function is called just before the specified property is destroyed.
QVariant attributeValue(const QtProperty *property, const QString &attribute) const override
Returns the given property's value for the specified attribute.
void initializeProperty(QtProperty *property) override
This function is called whenever a new valid property pointer has been created, passing the pointer a...
QIcon valueIcon(const QtProperty *property) const override
Returns an icon representing the current state of the given property.
int attributeType(int propertyType, const QString &attribute) const override
Returns the type of the specified attribute of the given propertyType.
int valueType(int propertyType) const override
This is an overloaded member function, provided for convenience. It differs from the above function o...
static uint alignDefault(const QtVariantProperty *prop)
DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent=nullptr)
QStringList attributes(int propertyType) const override
Returns a list of the given propertyType 's attributes.
QVariant value(const QtProperty *property) const override
Returns the given property's value.
void setValue(QtProperty *property, const QVariant &value) override
QString valueText(const QtProperty *property) const override
Returns a string representing the current state of the given property.
void connectPropertyManager(QtAbstractPropertyManager *manager)
void disconnectPropertyManager(QtAbstractPropertyManager *manager)
QWidget * editor(QWidget *subEditor, bool resettable, QtAbstractPropertyManager *manager, QtProperty *property, QWidget *parent)
bool value(const QtProperty *property, QVariant *rc) const
void initialize(QtVariantPropertyManager *m, QtProperty *property, const PropertySheetValue &value)
int valueChanged(QtVariantPropertyManager *m, QtProperty *property, const QVariant &value)
int setValue(QtVariantPropertyManager *m, QtProperty *property, int expectedTypeId, const QVariant &value)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.