summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-24 14:53:38 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-24 17:26:51 +0200
commitff97e083ed4dd233f499f72da4ed83e3a7f2b380 (patch)
treed586d48f4304b3974bf938a63b9a2069d4abd0e8 /src/widgets
parentc692f41ae51d3f2296d06178b98fe73476a51bc5 (diff)
Windows QPA: Move window properties to the new interfaces
Affects the custom margin used by QWizard. Task-number: QTBUG-83252 Change-Id: Iffda043f106282f682e119ec955fa2b2eb0f259e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 5a666b542b..8edbe14150 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -43,7 +43,8 @@
#include "qwizard_win_p.h"
#include <private/qapplication_p.h>
-#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformwindow_p.h>
#include "qwizard.h"
#include "qpaintengine.h"
#include "qapplication.h"
@@ -166,6 +167,8 @@ QVistaHelper::~QVistaHelper()
void QVistaHelper::updateCustomMargins(bool vistaMargins)
{
+ using namespace QPlatformInterface::Private;
+
if (QWindow *window = wizard->windowHandle()) {
// Reduce top frame to zero since we paint it ourselves. Use
// device pixel to avoid rounding errors.
@@ -176,11 +179,8 @@ void QVistaHelper::updateCustomMargins(bool vistaMargins)
// The dynamic property takes effect when creating the platform window.
window->setProperty("_q_windowsCustomMargins", customMarginsV);
// If a platform window exists, change via native interface.
- if (QPlatformWindow *platformWindow = window->handle()) {
- QGuiApplication::platformNativeInterface()->
- setWindowProperty(platformWindow, QStringLiteral("WindowsCustomMargins"),
- customMarginsV);
- }
+ if (auto platformWindow = dynamic_cast<QWindowsWindow *>(window->handle()))
+ platformWindow->setCustomMargins(customMarginsDp);
}
}