From 7af39fb960352e0504153c627db0615d80758ebe Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 5 Feb 2012 19:14:17 +0100 Subject: Fix potential endless loop in layout Usecase: - No scrollbar is shown - Window size will be decreased so that a scrollbar gets necessary The decreased window size minus the space required for the scrollbar results in a relayout of the items. In 99 % of all cases a decreased window size won't result in showing more items in parallel in comparison to a larger window size. However in the remaining 1 % this can happen (e.g. see bug 293318 for a sample). This results in an endless loop as now no scrollbar is required anymore, the layout changes again, the scrollbar is required again, ... BUG: 293318 FIXED-IN: 4.8.1 --- src/kitemviews/kitemlistcontainer.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/kitemviews/kitemlistcontainer.h') diff --git a/src/kitemviews/kitemlistcontainer.h b/src/kitemviews/kitemlistcontainer.h index 4d6eadbbb..b41f48a7f 100644 --- a/src/kitemviews/kitemlistcontainer.h +++ b/src/kitemviews/kitemlistcontainer.h @@ -70,6 +70,13 @@ private: void updateGeometries(); void updateSmoothScrollers(Qt::Orientation orientation); + /** + * Helper method for updateScrollOffsetScrollBar(). Updates the scrollbar-policy + * to Qt::ScrollBarAlwaysOn for cases where turning off the scrollbar might lead + * to an endless layout loop (see bug #293318). + */ + void updateScrollOffsetScrollBarPolicy(); + private: KItemListController* m_controller; -- cgit v1.3.1