aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2024-02-21 12:40:14 +0100
committerOliver Eftevaag <oliver.eftevaag@qt.io>2024-02-23 09:03:45 +0100
commitaa139231985c1bb2e5f893845c324205f8291b55 (patch)
tree5fe4ec34f31dd29c2ba01896bde95c88603bf965
parentf52afa7232ab7cce58e0357149be7d41086b32e7 (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.cpp5
-rw-r--r--src/quicktemplates/qquickpage_p.h3
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);