| 1 |
// Copyright (C) 2017 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#include "rasterwindow.h" |
| 5 |
#include <QDebug> |
| 6 |
|
| 7 |
int main(int argc, char **argv) |
| 8 |
{ |
| 9 |
QGuiApplication app(argc, argv); |
| 10 |
|
| 11 |
QStringList args = app.arguments(); |
| 12 |
|
| 13 |
WId winId = 0; |
| 14 |
if (args.count() > 1) { |
| 15 |
bool ok; |
| 16 |
winId = args[1].toUInt(&ok); |
| 17 |
Q_ASSERT(ok); |
| 18 |
} |
| 19 |
|
| 20 |
RasterWindow window; |
| 21 |
|
| 22 |
QWindow *foreign = QWindow::fromWinId(winId); |
| 23 |
Q_ASSERT(foreign != 0); |
| 24 |
|
| 25 |
window.setParent(foreign); |
| 26 |
window.show(); |
| 27 |
|
| 28 |
return app.exec(); |
| 29 |
} |