diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-26 17:23:22 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-26 17:23:22 +0200 |
commit | 639557d7e2df5fc1b3ffdc76188b3084c13a8fc3 (patch) | |
tree | 42e69f7c3aad68fe6b74f632fcb76a7135eb6228 /tools/designer/src | |
parent | 702a50367b13a137a9a87b499e4ab397be61383a (diff) | |
download | qt4-tools-639557d7e2df5fc1b3ffdc76188b3084c13a8fc3.tar.gz |
Fixed crash when encountering invalid forms.
Crash when replacing the QDockWidget contents
widget by a widget using a container extension.
Task-number: 254553
Diffstat (limited to 'tools/designer/src')
-rw-r--r-- | tools/designer/src/components/formeditor/formwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index 07d785afcb..66bab9b34d 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -2136,7 +2136,10 @@ void FormWindow::layoutContainer(QWidget *w, int type) bool FormWindow::hasInsertedChildren(QWidget *widget) const // ### move { if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(core()->extensionManager(), widget)) { - widget = container->widget(container->currentIndex()); + const int index = container->currentIndex(); + if (index < 0) + return false; + widget = container->widget(index); } const QWidgetList l = widgets(widget); |