From 52e933ce2b10b0e1b48afa9ce048552830309da7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 22 Oct 2016 21:18:52 +0200 Subject: Add QQuickDialog::title Dialog is incomplete without built-in support for title. All dialogs in the examples, screenshots, webinars, and blog posts have had a custom title. The Material and Universal designs both have specs for dialog titles. This commit adds support for dialog titles with appropriate looks (padding & font) out of the box. Task-number: QTBUG-56711 Change-Id: I248150313f1ce629a7105fdbe1c70c8fcd69e1cc Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdialog_p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/quicktemplates2/qquickdialog_p.h') diff --git a/src/quicktemplates2/qquickdialog_p.h b/src/quicktemplates2/qquickdialog_p.h index 1cd50f4a..ff8a1e79 100644 --- a/src/quicktemplates2/qquickdialog_p.h +++ b/src/quicktemplates2/qquickdialog_p.h @@ -58,6 +58,7 @@ class QQuickDialogPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialog : public QQuickPopup { Q_OBJECT + Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) Q_PROPERTY(QPlatformDialogHelper::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged FINAL) @@ -66,6 +67,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialog : public QQuickPopup public: explicit QQuickDialog(QObject *parent = nullptr); + QString title() const; + void setTitle(const QString &title); + QQuickItem *header() const; void setHeader(QQuickItem *header); @@ -83,6 +87,7 @@ Q_SIGNALS: void accepted(); void rejected(); + void titleChanged(); void headerChanged(); void footerChanged(); void standardButtonsChanged(); -- cgit v1.2.3