]> git.pld-linux.org Git - packages/qt4.git/blame - 0025-Fix-visual-index-lookup-in-QTreeViewPrivate-adjustVi.patch
add moc-boost-workaround.patch
[packages/qt4.git] / 0025-Fix-visual-index-lookup-in-QTreeViewPrivate-adjustVi.patch
CommitLineData
edb488de
AM
1From 6d76e943dab0971d376cebb15fe531efc60622ac Mon Sep 17 00:00:00 2001
2From: Friedemann Kleint <Friedemann.Kleint@digia.com>
3Date: Mon, 5 May 2014 10:59:56 +0200
4Subject: [PATCH 25/37] Fix visual index lookup in
5 QTreeViewPrivate::adjustViewOptionsForIndex().
6
7Determine the visual index by looking up the column of the QModelIndex
8in the logicalIndices array instead of looping.
9
10Task-number: QTBUG-37813
11Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d
12Reviewed-by: David Faure <david.faure@kdab.com>
13(cherry picked from qtbase/85aef2dd4b059d2ba9cba4605d9fef87f3e2c4fc)
14---
15 src/gui/itemviews/qtreeview.cpp | 11 ++---------
16 tests/auto/qtreeview/tst_qtreeview.cpp | 27 +++++++++++++++++++++++++++
17 2 files changed, 29 insertions(+), 9 deletions(-)
18
19diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
20index f506f48..fdf020e 100644
21--- a/src/gui/itemviews/qtreeview.cpp
22+++ b/src/gui/itemviews/qtreeview.cpp
23@@ -1367,15 +1367,8 @@ void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItemV4 *option,
24 const int right = (spanning ? header->visualIndex(0) : header->count() - 1 );
25 calcLogicalIndices(&logicalIndices, &viewItemPosList, left, right);
26
27- int columnIndex = 0;
28- for (int visualIndex = 0; visualIndex < current.column(); ++visualIndex) {
29- int logicalIndex = header->logicalIndex(visualIndex);
30- if (!header->isSectionHidden(logicalIndex)) {
31- ++columnIndex;
32- }
33- }
34-
35- option->viewItemPosition = viewItemPosList.at(columnIndex);
36+ const int visualIndex = logicalIndices.indexOf(current.column());
37+ option->viewItemPosition = viewItemPosList.at(visualIndex);
38 }
39
40
41--
421.9.3
43
This page took 0.049124 seconds and 4 git commands to generate.