summaryrefslogtreecommitdiffstats
path: root/tests/manual/xembed/qt-client-widget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/xembed/qt-client-widget/main.cpp')
-rw-r--r--tests/manual/xembed/qt-client-widget/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/manual/xembed/qt-client-widget/main.cpp b/tests/manual/xembed/qt-client-widget/main.cpp
new file mode 100644
index 0000000000..bd8b05b054
--- /dev/null
+++ b/tests/manual/xembed/qt-client-widget/main.cpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QApplication>
+#include <QDebug>
+#include <QWindow>
+
+#include "window.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QStringList args = app.arguments();
+
+ WId winId = 0;
+ if (args.count() > 1) {
+ bool ok;
+ winId = args[1].toUInt(&ok);
+ Q_ASSERT(ok);
+ }
+
+ Window window;
+
+ QWindow *foreign = QWindow::fromWinId(winId);
+ Q_ASSERT(foreign != 0);
+
+ window.windowHandle()->setParent(foreign);
+ window.show();
+
+ return app.exec();
+}