Prevent crash in tst_QWidget::persistentWinId().

Only call createWinId() if we have a parent widget set.
This commit is contained in:
Samuel Rødal 2011-06-03 10:07:01 +02:00
parent 504ab89c6a
commit 7d9fcaccb1

View File

@ -234,7 +234,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
if (!(f&Qt::Window) && (oldFlags&Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
//qDebug() << "setParent_sys() change from toplevel";
q->destroy();
} else if (wasCreated) {
} else if (newparent && wasCreated) {
q->createWinId();
}