summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZhang Yu <zhangyub@uniontech.com>2020-10-19 09:43:27 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-10-19 09:35:07 +0000
commitd9e3281115b7c574dfb30c5094a8f9441bd60e35 (patch)
tree61c5b2c57d1508f528b11dbb7dd1b728006be7c2 /src
parent4d70f2c19f93b1a22204dfb14036c5e62d8a2b10 (diff)
Fix QFontDialog::selectedFont() does not return actual selected font
"QFontDialog::accepted" was emitted before setting "selectedFont" to current font. So when calling "QFontDialog::selectedFont()" in slot of signal "QFontDialog::accepted",it does not return actual selected font. Fixes: QTBUG-87483 Change-Id: Ic9303e3df73ddd876fc78a0038f9379dbdf1853c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 407e171b40c3be3036ef71227d43c49f0b8d5788) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index fe8f88d64f..8e42804943 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -1006,7 +1006,6 @@ void QFontDialog::setVisible(bool visible)
void QFontDialog::done(int result)
{
Q_D(QFontDialog);
- QDialog::done(result);
if (result == Accepted) {
// We check if this is the same font we had before, if so we emit currentFontChanged
QFont selectedFont = currentFont();
@@ -1022,6 +1021,7 @@ void QFontDialog::done(int result)
d->receiverToDisconnectOnClose = nullptr;
}
d->memberToDisconnectOnClose.clear();
+ QDialog::done(result);
}
bool QFontDialogPrivate::canBeNativeDialog() const