summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxlistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxlistview.cpp')
-rw-r--r--src/declarative/fx/qfxlistview.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 8dfe171..4b28462 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -59,7 +59,7 @@ public:
attachedProperties.remove(parent());
}
- Q_PROPERTY(QFxListView *view READ view)
+ Q_PROPERTY(QFxListView *view READ view CONSTANT)
QFxListView *view() { return m_view; }
Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
@@ -212,8 +212,11 @@ public:
qreal startPosition() const {
qreal pos = 0;
- if (!visibleItems.isEmpty())
- pos = visibleItems.first()->position() - visibleIndex * (averageSize + spacing);
+ if (!visibleItems.isEmpty()) {
+ pos = visibleItems.first()->position();
+ if (visibleIndex > 0)
+ pos -= visibleIndex * (averageSize + spacing) - spacing;
+ }
return pos;
}