Fix embeddedwindows test on platforms without native window helper
Change-Id: I33074fc4a04982075a8c264bad41c56235e98cb6 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> (cherry picked from commit 5cf3d062f66677e77c0e288ba5544c6a835398e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ed6914e017
commit
9cd6cb67eb
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user