mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user