summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxlistview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-06 23:56:02 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-06 23:56:02 (GMT)
commitb8d72b6bf833ffd7e02afa1199a5d3beea8fe9a7 (patch)
treeac169cc9df2ff639e81b15dcaf268ed09d2e16cb /src/declarative/fx/qfxlistview.cpp
parent5584feca163e91588f08b0aa1f3ae2817cd90823 (diff)
parentd7fe798e022884dcbc58844e686a7d4fd39cf027 (diff)
downloadQt-b8d72b6bf833ffd7e02afa1199a5d3beea8fe9a7.zip
Qt-b8d72b6bf833ffd7e02afa1199a5d3beea8fe9a7.tar.gz
Qt-b8d72b6bf833ffd7e02afa1199a5d3beea8fe9a7.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfxlistview.cpp')
-rw-r--r--src/declarative/fx/qfxlistview.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 501b4df..1247021 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -178,6 +178,7 @@ public:
, moveReason(Other), buffer(0), highlightPosAnimator(0), highlightSizeAnimator(0), spacing(0.0)
, ownModel(false), wrap(false), autoHighlight(true)
, haveHighlightRange(false), strictHighlightRange(false)
+ , highlightMoveSpeed(400), highlightResizeSpeed(400)
{}
void init();
@@ -390,6 +391,8 @@ public:
QString sectionExpression;
QString currentSection;
qreal spacing;
+ qreal highlightMoveSpeed;
+ qreal highlightResizeSpeed;
bool ownModel : 1;
bool wrap : 1;
@@ -667,11 +670,11 @@ void QFxListViewPrivate::createHighlight()
const QLatin1String posProp(orient == Qt::Vertical ? "y" : "x");
highlightPosAnimator = new QmlEaseFollow(q);
highlightPosAnimator->setTarget(QmlMetaProperty(highlight->item, posProp));
- highlightPosAnimator->setVelocity(400);
+ highlightPosAnimator->setVelocity(highlightMoveSpeed);
highlightPosAnimator->setEnabled(autoHighlight);
const QLatin1String sizeProp(orient == Qt::Vertical ? "height" : "width");
highlightSizeAnimator = new QmlEaseFollow(q);
- highlightSizeAnimator->setVelocity(400);
+ highlightSizeAnimator->setVelocity(highlightResizeSpeed);
highlightSizeAnimator->setTarget(QmlMetaProperty(highlight->item, sizeProp));
highlightSizeAnimator->setEnabled(autoHighlight);
}
@@ -1259,6 +1262,48 @@ QString QFxListView::currentSection() const
return d->currentSection;
}
+/*!
+ \qmlproperty real ListView::highlightMoveSpeed
+
+ This property holds the moving animation speed of the highlight delegate.
+*/
+qreal QFxListView::highlightMoveSpeed() const
+{
+ Q_D(const QFxListView);\
+ return d->highlightMoveSpeed;
+}
+
+void QFxListView::setHighlightMoveSpeed(qreal speed)
+{
+ Q_D(QFxListView);\
+ if (d->highlightMoveSpeed != speed)
+ {
+ d->highlightMoveSpeed = speed;
+ emit highlightMoveSpeedChanged();
+ }
+}
+
+/*!
+ \qmlproperty real ListView::highlightResizeSpeed
+
+ This property holds the resizing animation speed of the highlight delegate.
+*/
+qreal QFxListView::highlightResizeSpeed() const
+{
+ Q_D(const QFxListView);\
+ return d->highlightResizeSpeed;
+}
+
+void QFxListView::setHighlightResizeSpeed(qreal speed)
+{
+ Q_D(QFxListView);\
+ if (d->highlightResizeSpeed != speed)
+ {
+ d->highlightResizeSpeed = speed;
+ emit highlightResizeSpeedChanged();
+ }
+}
+
void QFxListView::viewportMoved()
{
Q_D(QFxListView);