diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2018-12-26 22:19:14 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2019-01-15 01:28:00 +0200 |
commit | 7c572c488dcf84438d64da4ca920a48810044a72 (patch) | |
tree | 3e60394551f0dfa6e9a14e6900604dc4c1b09cb3 /src/qt/guiutil.cpp | |
parent | 035f349371a5b67922ce92c11ad9aa7178fa04f7 (diff) |
Add workaround for QProgressDialog bug on macOS
See: QTBUG-65750, QTBUG-70357.
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 2fc166b0c5..b84c07d51a 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -48,13 +48,15 @@ #include <QFileDialog> #include <QFont> #include <QFontDatabase> +#include <QFontMetrics> #include <QKeyEvent> #include <QLineEdit> +#include <QMouseEvent> +#include <QProgressDialog> #include <QSettings> #include <QTextDocument> // for Qt::mightBeRichText #include <QThread> #include <QUrlQuery> -#include <QMouseEvent> #if defined(Q_OS_MAC) #pragma GCC diagnostic push @@ -933,4 +935,16 @@ bool ItemDelegate::eventFilter(QObject *object, QEvent *event) return QItemDelegate::eventFilter(object, event); } +void PolishProgressDialog(QProgressDialog* dialog) +{ +#ifdef Q_OS_MAC + // Workaround for macOS-only Qt bug; see: QTBUG-65750, QTBUG-70357. + const int margin = dialog->fontMetrics().width("X"); + dialog->resize(dialog->width() + 2 * margin, dialog->height()); + dialog->show(); +#else + Q_UNUSED(dialog); +#endif +} + } // namespace GUIUtil |