diff options
author | Alexandr Akulich <akulichalexander@gmail.com> | 2016-06-16 10:50:34 +0500 |
---|---|---|
committer | Alexander Akulich <akulichalexander@gmail.com> | 2020-05-20 17:05:36 +0300 |
commit | 77dc5bcf368abb594e21230504419a48346b6753 (patch) | |
tree | 54393ba70d9725f2b613847bb80719541cdcc929 /src/quick/items/qquickpathview.cpp | |
parent | dfd3db5db85fb7a6a119b27ce047c4813b29ea03 (diff) |
QQuickPathView: Use setPosition() to update item position
Sequential call of setX() and setY() results in outdated y value on xChanged()
signal. Use setPosition() to set x and y at once.
Change-Id: I4054c2347f83d3eba4ead979c75f8dff8c3c19ea
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickpathview.cpp')
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 4a8089f49c..996db7af8e 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -440,8 +440,7 @@ void QQuickPathViewPrivate::updateItem(QQuickItem *item, qreal percent) } QQuickItemPrivate::get(item)->setCulled(percent >= 1); QPointF pf = path->pointAtPercent(qMin(percent, qreal(1))); - item->setX(pf.x() - item->width()/2); - item->setY(pf.y() - item->height()/2); + item->setPosition(pf - QPointF(item->width()/2, item->height()/2)); } void QQuickPathViewPrivate::regenerate() |