diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-06-21 08:21:36 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-22 07:04:40 (GMT) |
commit | a8a8afe5adc583eab4edca8c79d8eb7fca2e24ec (patch) | |
tree | b59026b821bf99ff3cb28cfca4c9e1701e05f96f | |
parent | f607530faf94bcee975a54042d817e9705a4dba1 (diff) | |
download | Qt-a8a8afe5adc583eab4edca8c79d8eb7fca2e24ec.zip Qt-a8a8afe5adc583eab4edca8c79d8eb7fca2e24ec.tar.gz Qt-a8a8afe5adc583eab4edca8c79d8eb7fca2e24ec.tar.bz2 |
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 <jaroslaw.kobus@digia.com>
(cherry picked from qttools/d251ee9dcbd015f2acbe76231902b72163cd05a2)
-rw-r--r-- | tools/designer/src/lib/shared/morphmenu.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/designer/src/lib/shared/morphmenu.cpp b/tools/designer/src/lib/shared/morphmenu.cpp index 073321b..67be71e 100644 --- a/tools/designer/src/lib/shared/morphmenu.cpp +++ b/tools/designer/src/lib/shared/morphmenu.cpp @@ -62,6 +62,7 @@ #include <QtGui/QApplication> #include <QtGui/QLayout> #include <QtGui/QUndoStack> +#include <QtGui/QSplitter> #include <QtGui/QFrame> #include <QtGui/QGroupBox> @@ -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<QSplitter *>(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); |