diff options
author | Liang Qi <[email protected]> | 2022-07-04 13:31:25 +0200 |
---|---|---|
committer | Liang Qi <[email protected]> | 2022-08-06 01:24:41 +0200 |
commit | aef55501bccd52f63a84228cb2ee201ec4f5c301 (patch) | |
tree | 447b4434e082d944de62939af239fde0338fd412 /tests/manual/xembed/qt-client-widget/main.cpp | |
parent | 8e9fdfec0afc01f192b222af60c13955a63b594f (diff) |
tests: replace gtk-embedder.py with a gtk3 app
All linux CI machines have gtk3 installed. And Python GTK things
are too complicate to setup.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I3c0d967f61aebea508784df79569b9d0064f66e2
Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'tests/manual/xembed/qt-client-widget/main.cpp')
-rw-r--r-- | tests/manual/xembed/qt-client-widget/main.cpp | 32 |
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 00000000000..59b1a76c6a0 --- /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 WITH Qt-GPL-exception-1.0 + +#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; + window.show(); + + QWindow *foreign = QWindow::fromWinId(winId); + Q_ASSERT(foreign != 0); + + window.windowHandle()->setParent(foreign); + + return app.exec(); +} |