diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-05-22 21:32:51 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-05-22 22:04:27 +0300 |
commit | 4935ac583bbdc289dd31a1caae3d711edef742b6 (patch) | |
tree | eebabb6c2aaafc55893c5f35ea00c35b29bb8839 /src/qt/guiutil.cpp | |
parent | 75850106aeecfed1d2dc16d8a67ec210c5826a47 (diff) | |
download | bitcoin-4935ac583bbdc289dd31a1caae3d711edef742b6.tar.xz |
qt: Improve GUI responsiveness
QProgressDialog estimates the time the operation will take (based on
time for steps), and only shows itself if that estimate is beyond
minimumDuration. The default minimumDuration value is 4 seconds, and it
could make users think that the GUI is frozen.
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d21f9074e7..534680ffa5 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -818,9 +818,12 @@ void PolishProgressDialog(QProgressDialog* dialog) // Workaround for macOS-only Qt bug; see: QTBUG-65750, QTBUG-70357. const int margin = TextWidth(dialog->fontMetrics(), ("X")); dialog->resize(dialog->width() + 2 * margin, dialog->height()); -#else - Q_UNUSED(dialog); #endif + // QProgressDialog estimates the time the operation will take (based on time + // for steps), and only shows itself if that estimate is beyond minimumDuration. + // The default minimumDuration value is 4 seconds, and it could make users + // think that the GUI is frozen. + dialog->setMinimumDuration(0); } int TextWidth(const QFontMetrics& fm, const QString& text) |