From: Friedemann Kleint Date: Fri, 21 Jun 2013 08:21:36 +0000 (+0200) Subject: Designer: Fix morphing of widgets in QSplitters. X-Git-Tag: accepted/tizen/20131212.181521~97^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d251ee9dcbd015f2acbe76231902b72163cd05a2;p=platform%2Fupstream%2Fqttools.git Designer: Fix morphing of widgets in QSplitters. They were not handled at all, children were just reparented resulting in the morphed widgets being appended. Task-number: QTBUG-31911 Change-Id: Idae8f66663416d514a2f3c299e58d726a3dd578a Reviewed-by: Jarek Kobus --- diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp index 516734d..8a47784 100644 --- a/src/designer/src/lib/shared/morphmenu.cpp +++ b/src/designer/src/lib/shared/morphmenu.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -457,6 +458,13 @@ void MorphWidgetCommand::morph(QWidget *before, QWidget *after) Q_ASSERT(lh); lh->replaceWidget(containingLayout, before, after); delete lh; + } else if (QSplitter *splitter = qobject_cast(parent)) { + const int index = splitter->indexOf(before); + before->hide(); + before->setParent(0); + splitter->insertWidget(index, after); + after->setParent(parent); + after->setGeometry(oldGeom); } else { before->hide(); before->setParent(0);