summaryrefslogtreecommitdiffstats
path: root/tools/designer
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-03-15 15:32:53 (GMT)
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-03-15 15:32:53 (GMT)
commitf4244785cb8875b177274db485a346605f05ed7c (patch)
tree2f6410a01145ae9aa56e88505acc1364165adb90 /tools/designer
parentb17ee2af5e3453191bb4568a388ea042562e1abc (diff)
downloadQt-f4244785cb8875b177274db485a346605f05ed7c.zip
Qt-f4244785cb8875b177274db485a346605f05ed7c.tar.gz
Qt-f4244785cb8875b177274db485a346605f05ed7c.tar.bz2
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 <jaroslaw.kobus@nokia.com>
Diffstat (limited to 'tools/designer')
-rw-r--r--tools/designer/src/lib/shared/widgetfactory.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp
index 887bb04..36f795e 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);