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
9QT_FORWARD_DECLARE_CLASS(QLabel)
10QT_FORWARD_DECLARE_CLASS(QToolButton)
11QT_FORWARD_DECLARE_CLASS(QDesignerFormEditorInterface)
12
13QT_BEGIN_NAMESPACE
14
15class QtProperty;
17
18namespace qdesigner_internal
19{
20
21class ResetWidget : public QWidget
22{
24public:
25 explicit ResetWidget(QWidget *editor, QWidget *parent = nullptr);
26
27 void setSpacing(int spacing);
28
29public Q_SLOTS:
30 void setResetEnabled(bool enabled);
31
33 void reset();
34
35private:
36 QToolButton *m_button;
37};
38
40{
42public:
44 QWidget *editor, QWidget *parent = nullptr);
45
46public Q_SLOTS:
48
51
52private Q_SLOTS:
53 void emitResetProperty();
54
55private:
56 const QDesignerFormEditorInterface *m_core;
57 QtProperty *m_property;
58};
59
60// A dummy editor used for parent properties of sub properties
61// that can be reset (for example, QSize, which does not have an editor).
62// It merely displays icon and value text of the property.
63class DummyEditor : public QWidget
64{
66public:
67 explicit DummyEditor(QtProperty *property, QWidget *parent = nullptr);
68
69 void setSpacing(int spacing);
70
71public Q_SLOTS:
73
74private:
75 void setValueIcon(const QIcon &icon);
76
77 QtProperty *m_property;
78 QLabel *m_textLabel;
79 QLabel *m_iconLabel;
80};
81} // namespace qdesigner_internal
82
83QT_END_NAMESPACE
84
85#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: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