wok annotate qt4/stuff/fix-scroll-when-last-item-is-removed.patch @ rev 7108

Added gnumeric icon.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Nov 03 06:32:24 2010 +0000 (2010-11-03)
parents
children
rev   line source
slaxemulator@6976 1 From 6da6b7099d4e0b49329793e4b90703ec3d868048 Mon Sep 17 00:00:00 2001
slaxemulator@6976 2 From: Frank Reininghaus <frank78ac@googlemail.com>
slaxemulator@6976 3 Date: Wed, 22 Sep 2010 10:19:59 +0200
slaxemulator@6976 4 Subject: [PATCH] QTreeView: do not scroll to top if last item is removed
slaxemulator@6976 5
slaxemulator@6976 6 When the last item is the current item and is removed,
slaxemulator@6976 7 QTreeViewPrivate::updateScrollBars() is called after QTreeViewPrivate's
slaxemulator@6976 8 viewItems member is cleared. This commit makes sure that viewItems is
slaxemulator@6976 9 restored by calling QTreeView::doItemsLayout() in this case, preventing
slaxemulator@6976 10 that the scroll bar range is set to zero temporarily and the view is
slaxemulator@6976 11 scrolled to the top unexpectedly (this was a regression in 4.7.0:
slaxemulator@6976 12 QTBUG-13567).
slaxemulator@6976 13
slaxemulator@6976 14 Merge-request: 2481
slaxemulator@6976 15 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
slaxemulator@6976 16 ---
slaxemulator@6976 17 src/gui/itemviews/qtreeview.cpp | 4 ++++
slaxemulator@6976 18 tests/auto/qtreeview/tst_qtreeview.cpp | 22 ++++++++++++++++++++++
slaxemulator@6976 19 2 files changed, 26 insertions(+), 0 deletions(-)
slaxemulator@6976 20
slaxemulator@6976 21 diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
slaxemulator@6976 22 index b797776..40b51fe 100644
slaxemulator@6976 23 --- a/src/gui/itemviews/qtreeview.cpp
slaxemulator@6976 24 +++ b/src/gui/itemviews/qtreeview.cpp
slaxemulator@6976 25 @@ -3435,6 +3435,10 @@ void QTreeViewPrivate::updateScrollBars()
slaxemulator@6976 26 if (!viewportSize.isValid())
slaxemulator@6976 27 viewportSize = QSize(0, 0);
slaxemulator@6976 28
slaxemulator@6976 29 + if (viewItems.isEmpty()) {
slaxemulator@6976 30 + q->doItemsLayout();
slaxemulator@6976 31 + }
slaxemulator@6976 32 +
slaxemulator@6976 33 int itemsInViewport = 0;
slaxemulator@6976 34 if (uniformRowHeights) {
slaxemulator@6976 35 if (defaultItemHeight <= 0)
slaxemulator@6976 36 --
slaxemulator@6976 37 1.6.1
slaxemulator@6976 38