diff options
author | Liang Qi <liang.qi@digia.com> | 2014-02-03 06:49:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-03 12:18:36 +0100 |
commit | a1df3e8537b7474db08e81bd1f0faebb13caebf4 (patch) | |
tree | 882c6215ccad563f05024c197100679733455021 /src/dialogs/qquickabstractfontdialog_p.h | |
parent | 0bbb32469adb3c49b110e2eb987caba58da80554 (diff) | |
download | qtquickcontrols-a1df3e8537b7474db08e81bd1f0faebb13caebf4.tar.gz |
Add currentFont property to FontDialog.
QFontDialog has this property. This patch effectively means that
the font property will be set when the dialog closes, instead of
whenever the current font in the dialog changes, so pressing cancel
will revert the font to what it was before the dialog was opened.
Align with e73d503b84be12e7bf28491356b459ca309e7c95 in qtdelarative,
the similar change for color dialog.
[ChangeLog][QtQuickControls][FontDialog] Added currentFont property.
Task-number: QTBUG-36574
Change-Id: I4140966543a677d8e654dbaac170a2fe8d3579a1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src/dialogs/qquickabstractfontdialog_p.h')
-rw-r--r-- | src/dialogs/qquickabstractfontdialog_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dialogs/qquickabstractfontdialog_p.h b/src/dialogs/qquickabstractfontdialog_p.h index 858a0d3e..2156eb79 100644 --- a/src/dialogs/qquickabstractfontdialog_p.h +++ b/src/dialogs/qquickabstractfontdialog_p.h @@ -70,6 +70,7 @@ class QQuickAbstractFontDialog : public QQuickAbstractDialog Q_PROPERTY(bool monospacedFonts READ monospacedFonts WRITE setMonospacedFonts NOTIFY monospacedFontsChanged) Q_PROPERTY(bool proportionalFonts READ proportionalFonts WRITE setProportionalFonts NOTIFY proportionalFontsChanged) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) + Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged) public: QQuickAbstractFontDialog(QObject *parent = 0); @@ -81,12 +82,14 @@ public: bool monospacedFonts() const; bool proportionalFonts() const; QFont font() const { return m_font; } + QFont currentFont() const { return m_currentFont; } public Q_SLOTS: void setVisible(bool v); void setModality(Qt::WindowModality m); void setTitle(const QString &t); void setFont(const QFont &arg); + void setCurrentFont(const QFont &arg); void setScalableFonts(bool arg); void setNonScalableFonts(bool arg); void setMonospacedFonts(bool arg); @@ -98,12 +101,14 @@ Q_SIGNALS: void monospacedFontsChanged(); void proportionalFontsChanged(); void fontChanged(); + void currentFontChanged(); void selectionAccepted(); protected: QPlatformFontDialogHelper *m_dlgHelper; QSharedPointer<QFontDialogOptions> m_options; QFont m_font; + QFont m_currentFont; Q_DISABLE_COPY(QQuickAbstractFontDialog) }; |