MCPcopy Create free account
hub / github.com/ElementsProject/elements / PolishProgressDialog

Function PolishProgressDialog

src/qt/guiutil.cpp:947–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945}
946
947void PolishProgressDialog(QProgressDialog* dialog)
948{
949#ifdef Q_OS_MAC
950 // Workaround for macOS-only Qt bug; see: QTBUG-65750, QTBUG-70357.
951 const int margin = TextWidth(dialog->fontMetrics(), ("X"));
952 dialog->resize(dialog->width() + 2 * margin, dialog->height());
953#endif
954 // QProgressDialog estimates the time the operation will take (based on time
955 // for steps), and only shows itself if that estimate is beyond minimumDuration.
956 // The default minimumDuration value is 4 seconds, and it could make users
957 // think that the GUI is frozen.
958 dialog->setMinimumDuration(0);
959}
960
961int TextWidth(const QFontMetrics& fm, const QString& text)
962{

Callers 3

showProgressMethod · 0.85
showProgressMethod · 0.85
showProgressDialogMethod · 0.85

Calls 3

TextWidthFunction · 0.85
resizeMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected