diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 4ecf071..d1e3335 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -770,6 +770,29 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc) return value; } +static int getSystemMetrics(int n) +{ + typedef int (WINAPI *PtrGetSystemMetrics)(int); + static PtrGetSystemMetrics getSystemMetricsPtr = 0; + if (!getSystemMetricsPtr) { + QSystemLibrary user32Lib(QLatin1String("user32")); + getSystemMetricsPtr = (PtrGetSystemMetrics)user32Lib.resolve("GetSystemMetrics"); + } + return getSystemMetricsPtr ? getSystemMetricsPtr(n) : 0; +} + +int QVistaHelper::frameSize() +{ + const int r = getSystemMetrics(SM_CYSIZEFRAME); + qDebug() << __FUNCTION__ << r; + return r; +} + +int QVistaHelper::captionSize() +{ + return GetSystemMetrics(SM_CYCAPTION); +} + bool QVistaHelper::resolveSymbols() { static bool tried = false; diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h index a7713d8..81514a8 100644 --- a/src/widgets/dialogs/qwizard_win_p.h +++ b/src/widgets/dialogs/qwizard_win_p.h @@ -117,8 +117,8 @@ private: bool drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc); static bool drawBlackRect(const QRect &rect, HDC hdc); - static int frameSize() { return GetSystemMetrics(SM_CYSIZEFRAME); } - static int captionSize() { return GetSystemMetrics(SM_CYCAPTION); } + static int frameSize(); + static int captionSize(); static int backButtonSize() { return int(QStyleHelper::dpiScaled(30)); } static int iconSize() { return 16; } // Standard Aero