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
16class QtProperty;
18
19namespace qdesigner_internal
20{
21
22class ResetWidget : public QWidget
23{
25public:
26 explicit ResetWidget(QtProperty *property, QWidget *parent = nullptr);
27
28 void setWidget(QWidget *widget);
29 void setResetEnabled(bool enabled);
30 void setValueText(const QString &text);
31 void setValueIcon(const QIcon &icon);
32 void setSpacing(int spacing);
33
36
37private slots:
38 void slotClicked();
39
40private:
41 QtProperty *m_property;
42 QLabel *m_textLabel;
43 QLabel *m_iconLabel;
44 QToolButton *m_button;
45 int m_spacing = -1;
46};
47
48class ResetDecorator : public QObject
49{
51public:
54
56 QWidget *editor(QWidget *subEditor, bool resettable, QtAbstractPropertyManager *manager, QtProperty *property,
57 QWidget *parent);
59 void setSpacing(int spacing);
60
63
64private slots:
66 void slotEditorDestroyed(QObject *object);
67
68private:
69 QHash<const QtProperty *, QList<ResetWidget *>> m_createdResetWidgets;
70 QHash<ResetWidget *, QtProperty *> m_resetWidgetToProperty;
71 int m_spacing = -1;
72 const QDesignerFormEditorInterface *m_core;
73};
74} // namespace qdesigner_internal
75
76QT_END_NAMESPACE
77
78#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
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QT_PROPERTYEDITOR_EXPORT