diff options
Diffstat (limited to 'tools/designer')
-rw-r--r-- | tools/designer/src/components/formeditor/qdesigner_resource.cpp | 2 | ||||
-rw-r--r-- | tools/designer/src/lib/shared/widgetfactory.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 714a556..073f125 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -1194,7 +1194,7 @@ QWidget *QDesignerResource::createWidget(const QString &widgetName, QWidget *par parentWidget->setProperty("_q_widgetOrder", QVariant::fromValue(list)); QList<QWidget *> zOrder = qvariant_cast<QWidgetList>(parentWidget->property("_q_zOrder")); zOrder.append(w); - parentWidget->setProperty("_q_zOrder", QVariant::fromValue(list)); + parentWidget->setProperty("_q_zOrder", QVariant::fromValue(zOrder)); } } else { core()->metaDataBase()->add(w); diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp index 945d7cc..bcd23ee 100644 --- a/tools/designer/src/lib/shared/widgetfactory.cpp +++ b/tools/designer/src/lib/shared/widgetfactory.cpp @@ -412,8 +412,10 @@ QWidget *WidgetFactory::createWidget(const QString &widgetName, QWidget *parentW // Currently happens in the case of Q3-Support widgets baseClass =fallBackBaseClass; } - w = createWidget(baseClass, parentWidget); - promoteWidget(core(),w,widgetName); + if (QWidget *promotedWidget = createWidget(baseClass, parentWidget)) { + promoteWidget(core(), promotedWidget, widgetName); + return promotedWidget; // Do not initialize twice. + } } while (false); Q_ASSERT(w != 0); |