diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-13 13:30:20 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-13 14:09:41 +0100 |
commit | 29521913732704306b7db824ac9ce4be461bffc8 (patch) | |
tree | d834bd3d78a833bf767c4ba813e2d838d12dd4f2 /src/quick/items/qquickflickable.cpp | |
parent | 7853634a1134a2b4b470a6d2c8b5da1610105d51 (diff) | |
parent | 6990ae6c1bad32952e371fa72bee65a7af11c313 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/quick/items/qquickwindow.cpp
src/quick/items/qquickwindow_p.h
tests/auto/quick/quick.pro
Change-Id: Ia12f20e95fb151bbbc75dbf187364a924cd0bc7a
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 2f639af790..ae5bdc3083 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -725,7 +725,19 @@ QQuickFlickable::~QQuickFlickable() These properties hold the surface coordinate currently at the top-left corner of the Flickable. For example, if you flick an image up 100 pixels, - \c contentY will be 100. + \c contentY will increase by 100. + + \note If you flick back to the origin (the top-left corner), after the + rebound animation, \c contentX will settle to the same value as \c originX, + and \c contentY to \c originY. These are usually (0,0), however ListView + and GridView may have an arbitrary origin due to delegate size variation, + or item insertion/removal outside the visible region. So if you want to + implement something like a vertical scrollbar, one way is to use + \c {y: (contentY - originY) * (height / contentHeight)} + for the position; another way is to use the normalized values in + \l {QtQuick::Flickable::visibleArea}{visibleArea}. + + \sa originX, originY */ qreal QQuickFlickable::contentX() const { @@ -2152,6 +2164,8 @@ void QQuickFlickable::setRightMargin(qreal m) This is usually (0,0), however ListView and GridView may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region. + + \sa contentX, contentY */ qreal QQuickFlickable::originY() const |