From b17ee2af5e3453191bb4568a388ea042562e1abc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Mar 2011 16:29:26 +0100 Subject: Designer: Fix a bug clearing the Z-Order when adding a new widget. Wrong list was used when adding widgets. Task-number: QTBUG-18120 Reviewed-by: Jarek Kobus --- tools/designer/src/components/formeditor/qdesigner_resource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/designer/src') diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 430b070a6d..6d718bbd0c 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -1190,7 +1190,7 @@ QWidget *QDesignerResource::createWidget(const QString &widgetName, QWidget *par parentWidget->setProperty("_q_widgetOrder", qVariantFromValue(list)); QList zOrder = qVariantValue(parentWidget->property("_q_zOrder")); zOrder.append(w); - parentWidget->setProperty("_q_zOrder", qVariantFromValue(list)); + parentWidget->setProperty("_q_zOrder", qVariantFromValue(zOrder)); } } else { core()->metaDataBase()->add(w); -- cgit v1.2.1 From f4244785cb8875b177274db485a346605f05ed7c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Mar 2011 16:32:53 +0100 Subject: Designer: Fix a bug affecting tab reordering of promoted tab widgets. Event filter was added twice due to widget initialization being done twice caused by recursion of WidgetFactory::createWidget() in the case of a fallback to promotion when a custom widget plugin is missing. Task-number: QTBUG-18121 Reviewed-by: Jarek Kobus --- tools/designer/src/lib/shared/widgetfactory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/designer/src') diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp index 887bb04cd4..36f795eb6c 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); -- cgit v1.2.1