summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxlistview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-07-27 07:07:43 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-07-27 07:07:43 (GMT)
commit2ea4aec304eefa10a554e40c5f9ea948d18617a7 (patch)
treef04039fed6d3c35aea98fc91d0c6b3238faa6161 /src/declarative/fx/qfxlistview.cpp
parentfaa0ac671056c49dd6937022c08b5a3964c49635 (diff)
downloadQt-2ea4aec304eefa10a554e40c5f9ea948d18617a7.zip
Qt-2ea4aec304eefa10a554e40c5f9ea948d18617a7.tar.gz
Qt-2ea4aec304eefa10a554e40c5f9ea948d18617a7.tar.bz2
Don't crash in Horizontal orientation.
Diffstat (limited to 'src/declarative/fx/qfxlistview.cpp')
-rw-r--r--src/declarative/fx/qfxlistview.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index db80967..f300d1e 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -808,9 +808,11 @@ void QFxListViewPrivate::fixupX()
if (orient == Qt::Vertical)
return;
if (currItemMode == QFxListView::SnapAuto) {
- moveReason = Mouse;
- _tl.clear();
- _tl.move(_moveX, -(currentItem->position() - snapPos), QEasingCurve(QEasingCurve::InOutQuad), 200);
+ if (currentItem) {
+ moveReason = Mouse;
+ _tl.clear();
+ _tl.move(_moveX, -(currentItem->position() - snapPos), QEasingCurve(QEasingCurve::InOutQuad), 200);
+ }
} else if (currItemMode == QFxListView::Snap) {
moveReason = Mouse;
int idx = snapIndex();