tests: make xembed/qt-client-widget better

See also QX11EmbedWidget::QX11EmbedWidget() in src/gui/kernel/qx11embed_x11.cpp in qt4.

https: //github.com/qt/qt/blob/4.8/src/gui/kernel/qx11embed_x11.cpp#L475-L477

Change-Id: I47504a2d8f3e33c367f092d01ee5d7e1b16b5106
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a0ec35d5f290ce07c591fb3f075390e592326d2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Liang Qi 2022-07-04 13:34:19 +02:00 committed by Qt Cherry-pick Bot
parent eaa755dbc9
commit 1c27eaf9b8
2 changed files with 5 additions and 1 deletions

View File

@ -21,12 +21,12 @@ int main(int argc, char *argv[])
}
Window window;
window.show();
QWindow *foreign = QWindow::fromWinId(winId);
Q_ASSERT(foreign != 0);
window.windowHandle()->setParent(foreign);
window.show();
return app.exec();
}

View File

@ -7,6 +7,10 @@
Window::Window()
{
setAttribute(Qt::WA_NativeWindow);
setAttribute(Qt::WA_DontCreateNativeAncestors);
createWinId();
QGroupBox *echoGroup = new QGroupBox(tr("Echo"));
QLabel *echoLabel = new QLabel(tr("Mode:"));