diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2024-02-21 12:40:14 +0100 |
---|---|---|
committer | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2024-02-23 09:03:45 +0100 |
commit | aa139231985c1bb2e5f893845c324205f8291b55 (patch) | |
tree | 5fe4ec34f31dd29c2ba01896bde95c88603bf965 | |
parent | f52afa7232ab7cce58e0357149be7d41086b32e7 (diff) |
QQuickPage: make the title property resettablewip/popupwindow
The title property didn't have a RESET function, which made unsetting it
less elegant.
Change-Id: I9cf5df8fd36681507fd2aaeb0cbbcb3d6ce771cb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quicktemplates/qquickpage.cpp | 5 | ||||
-rw-r--r-- | src/quicktemplates/qquickpage_p.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/quicktemplates/qquickpage.cpp b/src/quicktemplates/qquickpage.cpp index 55c6d3a178..9f19f5bae3 100644 --- a/src/quicktemplates/qquickpage.cpp +++ b/src/quicktemplates/qquickpage.cpp @@ -280,6 +280,11 @@ void QQuickPage::setTitle(const QString &title) emit titleChanged(); } +void QQuickPage::resetTitle() +{ + setTitle(QString()); +} + /*! \qmlproperty Item QtQuick.Controls::Page::header diff --git a/src/quicktemplates/qquickpage_p.h b/src/quicktemplates/qquickpage_p.h index 02725cc7c5..7eaa443146 100644 --- a/src/quicktemplates/qquickpage_p.h +++ b/src/quicktemplates/qquickpage_p.h @@ -25,7 +25,7 @@ class QQuickPagePrivate; class Q_QUICKTEMPLATES2_EXPORT QQuickPage : public QQuickPane { Q_OBJECT - Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) + Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged RESET resetTitle FINAL) Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) // 2.5 (Qt 5.12) @@ -42,6 +42,7 @@ public: QString title() const; void setTitle(const QString &title); + void resetTitle(); QQuickItem *header() const; void setHeader(QQuickItem *header); |