diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-12-04 15:44:00 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-01-08 13:15:09 +0000 |
commit | 9c7429219d36e8eb40e1fe6e679715c89209fc40 (patch) | |
tree | d5a4999c774adf49f724886995ad05e3387caa7d /src/quicktemplates2/qquicksplitview_p_p.h | |
parent | ce9940ca550d70931248a98fc4d47f10959a9a9e (diff) |
SplitView: schedule another layout if requested sizes changed during layout
As mentioned in the review of ed87e837, there could be a scenario where the
user sets the preferred size of an item inside the onWidthChanged handler
of another item:
onWidthChanged: if (width < 10) secondItem.SplitView.preferredWidth = 100
Before this patch, this would result in the preferredWidth assignment being
ignored since it happened during a layout.
This patch adds some auto tests to ensure that this works, as the previous
patch (that converted layouts to be done in polish/updatePolish cycles)
already fixed the issue.
It also adds a check to avoid doing too many layouts in the case of
one of the split handles being dragged.
Change-Id: Ide519b33a2fa3bf746ae3793e0671fd1750c70d8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicksplitview_p_p.h')
-rw-r--r-- | src/quicktemplates2/qquicksplitview_p_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicksplitview_p_p.h b/src/quicktemplates2/qquicksplitview_p_p.h index 560276f0..5d71d461 100644 --- a/src/quicktemplates2/qquicksplitview_p_p.h +++ b/src/quicktemplates2/qquicksplitview_p_p.h @@ -106,7 +106,6 @@ public: static QQuickSplitViewPrivate *get(QQuickSplitView *splitView); -private: Qt::Orientation m_orientation = Qt::Horizontal; QQmlComponent *m_handle = nullptr; QVector<QQuickItem*> m_handleItems; @@ -119,6 +118,7 @@ private: qreal m_rightOrBottomItemSizeBeforePress = 0.0; int m_fillIndex = -1; bool m_layingOut = false; + bool m_ignoreNextLayoutRequest = false; bool m_resizing = false; }; |