Fix embeddedwindows test on platforms without native window helper

Pick-to: 6.6
Change-Id: I33074fc4a04982075a8c264bad41c56235e98cb6
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-08-08 15:01:23 +02:00
parent 63dbc5c05d
commit 5cf3d062f6

View File

@ -3,7 +3,10 @@
#include <QtGui>
#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || defined(Q_OS_WIN)
#include "../../shared/nativewindow.h"
#define HAVE_NATIVE_WINDOW
#endif
#include <QDebug>
@ -69,6 +72,7 @@ int main(int argc, char *argv[])
transparentChildWindow->setGeometry(350, 50, 100, 100);
transparentChildWindow->showNormal();
#if defined(HAVE_NATIVE_WINDOW)
NativeWindow nativeWindow;
if (QWindow *foreignWindow = QWindow::fromWinId(nativeWindow)) {
foreignWindow->setParent(&window);
@ -95,6 +99,7 @@ int main(int argc, char *argv[])
maskedChildWindowOfNativeWindow->setGeometry(25, 25, 50, 50);
maskedChildWindowOfNativeWindow->showNormal();
}
#endif
window.show();