desktopWidget = parent;
bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget;
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC)
if (newParent && parent && !desktopWidget) {
if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)
#ifdef Q_WS_MAC
else if (parent->d_func()->nativeChildrenForced() || parent->testAttribute(Qt::WA_PaintOnScreen))
setAttribute(Qt::WA_NativeWindow);
}
-#endif
if (wasCreated) {
if (!testAttribute(Qt::WA_WState_Hidden)) {
if (!(f&Qt::Window) && (oldFlags&Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
//qDebug() << "setParent_sys() change from toplevel";
q->destroy();
- } else if (newparent && wasCreated) {
- q->createWinId();
}
adjustFlags(f, q);
q->setAttribute(Qt::WA_WState_Visible, false);
q->setAttribute(Qt::WA_WState_Hidden, false);
+ if (newparent && wasCreated && (q->testAttribute(Qt::WA_NativeWindow) || (f & Qt::Window)))
+ q->createWinId();
+
if (q->isWindow() || (!newparent || newparent->isVisible()) || explicitlyHidden)
q->setAttribute(Qt::WA_WState_Hidden);
q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
topLevel.show();
QVERIFY(topLevel.internalWinId());
- if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("windows"))
- QEXPECT_FAIL("", "QTBUG-26424", Continue);
QVERIFY(widget->testAttribute(Qt::WA_NativeWindow));
- if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("windows"))
- QEXPECT_FAIL("", "QTBUG-26424", Continue);
QVERIFY(child->internalWinId());
- if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("windows"))
- QEXPECT_FAIL("", "QTBUG-26424", Continue);
QVERIFY(child->testAttribute(Qt::WA_NativeWindow));
QVERIFY(!child->testAttribute(Qt::WA_PaintOnScreen));
QVERIFY(!dummy->internalWinId());