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
brushpropertymanager.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// Qt-Security score:significant reason:default
4
5#ifndef BRUSHPROPERTYMANAGER_H
6#define BRUSHPROPERTYMANAGER_H
7
8#include <QtCore/qhash.h>
9#include <QtGui/qbrush.h>
10#include <QtGui/qicon.h>
11
12QT_BEGIN_NAMESPACE
13
14class QtProperty;
16
17class QString;
18class QVariant;
19
20namespace qdesigner_internal {
21
22// BrushPropertyManager: A mixin for DesignerPropertyManager that manages brush properties.
23
25public:
27
30
31 void initializeProperty(QtVariantPropertyManager *vm, QtProperty *property, int enumTypeId);
32 bool uninitializeProperty(QtProperty *property);
33
34 // Call from slotValueChanged().
35 int valueChanged(QtVariantPropertyManager *vm, QtProperty *property, const QVariant &value);
36 int setValue(QtVariantPropertyManager *vm, QtProperty *property, const QVariant &value);
37
38 bool valueText(const QtProperty *property, QString *text) const;
39 bool valueIcon(const QtProperty *property, QIcon *icon) const;
40 bool value(const QtProperty *property, QVariant *v) const;
41
42 // Call from QtPropertyManager's propertyDestroyed signal
43 void slotPropertyDestroyed(QtProperty *property);
44
45private:
46 static int brushStyleToIndex(Qt::BrushStyle st);
47 static Qt::BrushStyle brushStyleIndexToStyle(int brushStyleIndex);
48 static QString brushStyleIndexToString(int brushStyleIndex);
49
50 static const QMap<int, QIcon> &brushStyleIcons();
51
53 PropertyToPropertyMap m_brushPropertyToStyleSubProperty;
54 PropertyToPropertyMap m_brushPropertyToColorSubProperty;
55 PropertyToPropertyMap m_brushStyleSubPropertyToProperty;
56 PropertyToPropertyMap m_brushColorSubPropertyToProperty;
57
58 QHash<const QtProperty *, QBrush> m_brushValues;
59};
60
61}
62
63QT_END_NAMESPACE
64
65#endif // BRUSHPROPERTYMANAGER_H
static const char * brushStyles[]
The QtProperty class encapsulates an instance of a property.
void addSubProperty(QtProperty *property)
Appends the given property to this property's subproperties.
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)
Auxiliary methods to store/retrieve settings.