summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-05-26 15:23:22 (GMT)
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-05-26 15:23:22 (GMT)
commit639557d7e2df5fc1b3ffdc76188b3084c13a8fc3 (patch)
tree42e69f7c3aad68fe6b74f632fcb76a7135eb6228 /tools
parent702a50367b13a137a9a87b499e4ab397be61383a (diff)
downloadQt-639557d7e2df5fc1b3ffdc76188b3084c13a8fc3.zip
Qt-639557d7e2df5fc1b3ffdc76188b3084c13a8fc3.tar.gz
Qt-639557d7e2df5fc1b3ffdc76188b3084c13a8fc3.tar.bz2
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')
-rw-r--r--tools/designer/src/components/formeditor/formwindow.cpp5
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 07d785a..66bab9b 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);