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// Qt-Security score:significant reason:default
4
5#ifndef RESETDECORATOR_H
6#define RESETDECORATOR_H
7
8#include <QtWidgets/qwidget.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(QWidget *editor, QWidget *parent = nullptr);
27
28 void setSpacing(int spacing);
29
30public Q_SLOTS:
31 void setResetEnabled(bool enabled);
32
34 void reset();
35
36private:
37 QToolButton *m_button;
38};
39
41{
43public:
45 QWidget *editor, QWidget *parent = nullptr);
46
47public Q_SLOTS:
49
52
53private Q_SLOTS:
54 void emitResetProperty();
55
56private:
57 const QDesignerFormEditorInterface *m_core;
58 QtProperty *m_property;
59};
60
61// A dummy editor used for parent properties of sub properties
62// that can be reset (for example, QSize, which does not have an editor).
63// It merely displays icon and value text of the property.
64class DummyEditor : public QWidget
65{
67public:
68 explicit DummyEditor(QtProperty *property, QWidget *parent = nullptr);
69
70 void setSpacing(int spacing);
71
72public Q_SLOTS:
74
75private:
76 void setValueIcon(const QIcon &icon);
77
78 QtProperty *m_property;
79 QLabel *m_textLabel;
80 QLabel *m_iconLabel;
81};
82} // namespace qdesigner_internal
83
84QT_END_NAMESPACE
85
86#endif // RESETDECORATOR_H
The QDesignerFormEditorInterface class allows you to access Qt Widgets Designer's various components.
friend class QWidget
Definition qpainter.h:432
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)
TextPropertyValidationMode textPropertyValidationMode() const
QFont richTextDefaultFont() const
Definition texteditor.h:40
void setRichTextDefaultFont(const QFont &font)
Definition texteditor.h:39
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