We need to call setWinId() at appropriate times, and enable creation of
native handles for child widgets when createWinId() is called.
qDebug() << "QWidget::winId: creating native window for" << this;
#endif
QWidget *that = const_cast<QWidget*>(this);
-#ifndef Q_WS_QPA
that->setAttribute(Qt::WA_NativeWindow);
-#endif
that->d_func()->createWinId();
return that->data->winid;
}
Q_Q(QWidget);
Qt::WindowFlags oldFlags = data.window_flags;
+ bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
int targetScreen = -1;
// Handle a request to move the widget to a particular screen
newparent = 0;
}
+ setWinId(0);
+
if (parent != newparent) {
QObjectPrivate::setParent_helper(newparent); //### why does this have to be done in the _sys function???
if (q->windowHandle()) {
if (!(f&Qt::Window) && (oldFlags&Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
//qDebug() << "setParent_sys() change from toplevel";
q->destroy();
+ } else if (wasCreated) {
+ q->createWinId();
}
adjustFlags(f, q);