summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-01-27 09:26:42 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-01-29 11:39:58 +0000
commit316d2e3830f085b0d27909975882eeccf785e283 (patch)
tree41d879061d5b672e14ad2fb8f5f4d75824604027
parenta6a665bdb147d0a0fbfcd65053718a54e1d9815b (diff)
FormWindow::layoutContainer(): Fix check for empty child widget list.
Move check after filtering out the non-managed widgets. This fixes a crash happening in QMainWindow forms where the central widget is manually edited to a container-type widget. Task-number: QTBUG-50563 Change-Id: I4df600fe0a63ecfbb8be741f8c3d8027cee7528b Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index fdaed87b4..4d1d0abd9 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -2188,8 +2188,6 @@ void FormWindow::layoutContainer(QWidget *w, int type)
w = core()->widgetFactory()->containerOfWidget(w);
const QObjectList l = w->children();
- if (l.isEmpty())
- return;
// find managed widget children
QWidgetList widgets;
const QObjectList::const_iterator ocend = l.constEnd();
@@ -2200,6 +2198,9 @@ void FormWindow::layoutContainer(QWidget *w, int type)
widgets.append(widget);
}
+ if (widgets.isEmpty()) // QTBUG-50563, observed when using hand-edited forms.
+ return;
+
LayoutCommand *cmd = new LayoutCommand(this);
cmd->init(mainContainer(), widgets, static_cast<LayoutInfo::Type>(type), w);
clearSelection(false);