diff options
author | Alberto Mardegan <info@mardy.it> | 2015-07-11 15:24:53 +0300 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-07-20 19:30:43 +0000 |
commit | 134d980a7fcf61c5440019bcfb3fdfc39c3f5f3c (patch) | |
tree | 4057dc82065edfaea18d7bc8f13d523b31e2b0f0 /src/quick/items/qquickgridview.cpp | |
parent | 49874ec12a821c165ab31ec90d98eb5c4dec30dc (diff) |
Don't change the currentItem after a viewport resize
When highlightRangeMode is set to StrictlyEnforceRange and the view gets
resized, we don't want the currentIndex to change.
The code touched by this patch was introduced by commit
I08b7e61496a79f71c3b40fafaca985ae90f88503 back in Qt 4.7 times, and
never changed since then.
Task-number: QTBUG-43555
Change-Id: Ie67faa6898f13a1f7b0f1c4ae6c29721cb7dfa41
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickgridview.cpp')
-rw-r--r-- | src/quick/items/qquickgridview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index e3f216b3a2..ff928a599f 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -922,13 +922,13 @@ void QQuickGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte tempPosition -= bias; } FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart); - if (!topItem && strictHighlightRange && currentItem) { + if (strictHighlightRange && currentItem) { // StrictlyEnforceRange always keeps an item in range updateHighlight(); topItem = currentItem; } FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd); - if (!bottomItem && strictHighlightRange && currentItem) { + if (strictHighlightRange && currentItem) { // StrictlyEnforceRange always keeps an item in range updateHighlight(); bottomItem = currentItem; |