2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2024-02-02 13:36:10 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2013-02-27 08:48:11 +00:00
|
|
|
|
|
|
|
#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);
|
2022-07-04 11:34:19 +00:00
|
|
|
window.show();
|
2013-02-27 08:48:11 +00:00
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|