summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Yu <zhangyub@uniontech.com>2020-10-19 09:43:27 +0800
committerZhang Yu <zhangyub@uniontech.com>2020-10-19 14:01:12 +0800
commit407e171b40c3be3036ef71227d43c49f0b8d5788 (patch)
treeef196aa8c79fd56e18432dda047d04fffed6e6e4
parentaee81c00cfedcc878580da1afe5b3d407d32e40f (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 Pick-to: 5.15 Change-Id: Ic9303e3df73ddd876fc78a0038f9379dbdf1853c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-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