diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-05 12:51:10 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-08 18:42:30 +0000 |
commit | 6accc102d3300986fcfa7417d3371f6556f8361a (patch) | |
tree | dcf152d729b80b490cc69a0448700b3b36e3c15a /src/widgets/dialogs/qwizard.cpp | |
parent | 58b4e0736919e0504f5ca5307ad7aefa894a6f38 (diff) | |
download | qtbase-6accc102d3300986fcfa7417d3371f6556f8361a.tar.gz |
QStyle/QWidget: Avoid repetitive invocation of QStyleHelper::dpiScaled()
Store the result of QStyleHelper::dpiScaled() or functions dependent on it
in a variable, preparing the addition of a DPI parameter.
Task-number: QTBUG-45055
Change-Id: Ic70d65b590793c29a4b1f7a7a5312dd169517fc5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/dialogs/qwizard.cpp')
-rw-r--r-- | src/widgets/dialogs/qwizard.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index c692a0f8db..f428114bbe 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1595,23 +1595,25 @@ bool QWizardPrivate::handleAeroStyleChange() bool vistaMargins = false; if (isVistaThemeEnabled()) { + const int topOffset = vistaHelper->topOffset(); + const int topPadding = vistaHelper->topPadding(); if (isVistaThemeEnabled(QVistaHelper::VistaAero)) { if (isWindow) { vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar); q->installEventFilter(vistaHelper); } q->setMouseTracking(true); - antiFlickerWidget->move(0, vistaHelper->titleBarSize() + vistaHelper->topOffset()); + antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset); vistaHelper->backButton()->move( - 0, vistaHelper->topOffset() // ### should ideally work without the '+ 1' - - qMin(vistaHelper->topOffset(), vistaHelper->topPadding() + 1)); + 0, topOffset // ### should ideally work without the '+ 1' + - qMin(topOffset, topPadding + 1)); vistaMargins = true; vistaHelper->backButton()->show(); } else { if (isWindow) vistaHelper->setDWMTitleBar(QVistaHelper::NormalTitleBar); q->setMouseTracking(true); - antiFlickerWidget->move(0, vistaHelper->topOffset()); + antiFlickerWidget->move(0, topOffset); vistaHelper->backButton()->move(0, -1); // ### should ideally work with (0, 0) } if (isWindow) |