diff options
-rw-r--r-- | src/widgets/widgets/qdockarealayout.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qdockarealayout_p.h | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 2 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp | 5 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index a07ab73ad0..5adb2f1c95 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2631,8 +2631,6 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, QSize bottom_max = docks[QInternal::BottomDock].maximumSize(); bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min); - fallbackToSizeHints = false; - if (_ver_struct_list != 0) { QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list; ver_struct_list.resize(3); diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h index 17078f3709..10eb0da651 100644 --- a/src/widgets/widgets/qdockarealayout_p.h +++ b/src/widgets/widgets/qdockarealayout_p.h @@ -232,7 +232,7 @@ public: QDockAreaLayout(QMainWindow *win); QDockAreaLayoutInfo docks[4]; int sep; // separator extent - bool fallbackToSizeHints; //determines if we should use the sizehint for the dock areas (true until the layout is restored or the central widget is set) + bool fallbackToSizeHints; //determines if we should use the sizehint for the dock areas (true until the layout is restored or the separator is moved by user) mutable QVector<QWidget*> separatorWidgets; bool isValid() const; diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index c67881e652..ff05503540 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -1351,6 +1351,8 @@ bool QMainWindowLayout::startSeparatorMove(const QPoint &pos) if (movingSeparator.isEmpty()) return false; + layoutState.dockAreaLayout.fallbackToSizeHints = false; + savedState = layoutState; movingSeparatorPos = movingSeparatorOrigin = pos; diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 0f07546559..c6a039cb37 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -1435,6 +1435,11 @@ void MoveSeparator::apply(QMainWindow *mw) const } QVERIFY(!path.isEmpty()); + // For QTBUG-15689: + // Following commands is used to simulate user move action. A better way should + // use QMainWindowLayout::startSeparatorMove/separatorMove/endSeparatorMove, + // but then we will need real start/end position coordinates. + l->layoutState.dockAreaLayout.fallbackToSizeHints = false; l->layoutState.dockAreaLayout.separatorMove(path, QPoint(0, 0), QPoint(delta, delta)); } #endif |