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
resetdecorator.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 RESETDECORATOR_H
5#define RESETDECORATOR_H
6
7#include <QtWidgets/qwidget.h>
8#include <QtCore/qhash.h>
9
10QT_FORWARD_DECLARE_CLASS(QLabel)
11QT_FORWARD_DECLARE_CLASS(QToolButton)
12QT_FORWARD_DECLARE_CLASS(QDesignerFormEditorInterface)
13
14QT_BEGIN_NAMESPACE
15
16using namespace Qt::StringLiterals;
17
18class QtProperty;
20
21namespace qdesigner_internal
22{
23
24class ResetWidget : public QWidget
25{
27public:
28 explicit ResetWidget(QtProperty *property, QWidget *parent = nullptr);
29
30 void setWidget(QWidget *widget);
31 void setResetEnabled(bool enabled);
32 void setValueText(const QString &text);
33 void setValueIcon(const QIcon &icon);
34 void setSpacing(int spacing);
35
38
39private slots:
40 void slotClicked();
41
42private:
43 QtProperty *m_property;
44 QLabel *m_textLabel;
45 QLabel *m_iconLabel;
46 QToolButton *m_button;
47 int m_spacing = -1;
48};
49
50class ResetDecorator : public QObject
51{
53public:
56
58 QWidget *editor(QWidget *subEditor, bool resettable, QtAbstractPropertyManager *manager, QtProperty *property,
59 QWidget *parent);
61 void setSpacing(int spacing);
62
65
66private slots:
68 void slotEditorDestroyed(QObject *object);
69
70private:
71 QHash<const QtProperty *, QList<ResetWidget *>> m_createdResetWidgets;
72 QHash<ResetWidget *, QtProperty *> m_resetWidgetToProperty;
73 int m_spacing = -1;
74 const QDesignerFormEditorInterface *m_core;
75};
76} // namespace qdesigner_internal
77
78QT_END_NAMESPACE
79
80#endif // RESETDECORATOR_H
The QDesignerFormEditorInterface class allows you to access Qt Widgets Designer's various components.
friend class QWidget
Definition qpainter.h:431
The QtAbstractPropertyManager provides an interface for property managers.
The QtProperty class encapsulates an instance of a property.
void setSuperPalette(const QPalette &palette)
static QString msgMissingThemeIcon(const QString &t)
void setTheme(const QString &theme)
void setDefaultPixmap(const QPixmap &pixmap)
static QString displayText(const PropertySheetIconValue &icon)
void setPixmapCache(DesignerPixmapCache *cache)
static QString msgThemeIcon(const QString &t)
void setDefaultPixmapIcon(const QIcon &icon)
void setIconThemeModeEnabled(bool enabled)
void contextMenuEvent(QContextMenuEvent *event) override
This event handler, for event event, can be reimplemented in a subclass to receive widget context men...
void themeEnumChanged(int themeEnum)
void themeChanged(const QString &theme)
void setRange(qlonglong bottom, qlonglong top)
QLongLongValidator(qlonglong bottom, qlonglong top, QObject *parent)
QULongLongValidator(qulonglong bottom, qulonglong top, QObject *parent)
void setRange(qulonglong bottom, qulonglong top)
void connectPropertyManager(QtAbstractPropertyManager *manager)
void disconnectPropertyManager(QtAbstractPropertyManager *manager)
QWidget * editor(QWidget *subEditor, bool resettable, QtAbstractPropertyManager *manager, QtProperty *property, QWidget *parent)
void setValueIcon(const QIcon &icon)
void setValueText(const QString &text)
void setWidget(QWidget *widget)
TextPropertyValidationMode textPropertyValidationMode() const
QFont richTextDefaultFont() const
Definition texteditor.h:39
void setRichTextDefaultFont(const QFont &font)
Definition texteditor.h:38
void setTextPropertyValidationMode(TextPropertyValidationMode vm)
static constexpr auto defaultResourceAttributeC
static constexpr auto themeEnumAttributeC
static constexpr auto flagsAttributeC
static constexpr auto validationModesAttributeC
static constexpr auto resettableAttributeC
static constexpr auto themeAttributeC
static constexpr auto superPaletteAttributeC
static constexpr auto fontAttributeC
Auxiliary methods to store/retrieve settings.
#define QT_PROPERTYEDITOR_EXPORT