From 97ff7edffb23517f21b07e74283cae67c2dfca7f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 2 Jul 2018 10:47:25 +0200 Subject: Doc: add a section that demonstrates various contentX/contentY states This makes it easier to visualize how the properties work. Change-Id: I04cb1a99a1f831e5c892cb27e4a0cd127fe450e0 Reviewed-by: Venugopal Shivashankar --- .../doc/images/flickable-contentXY-bottom-left.png | Bin 0 -> 2780 bytes .../images/flickable-contentXY-bottom-left.svgz | Bin 0 -> 1575 bytes .../images/flickable-contentXY-bottom-right.png | Bin 0 -> 2386 bytes .../images/flickable-contentXY-bottom-right.svgz | Bin 0 -> 1580 bytes .../doc/images/flickable-contentXY-resting.png | Bin 0 -> 430 bytes .../doc/images/flickable-contentXY-resting.svgz | Bin 0 -> 1083 bytes .../doc/images/flickable-contentXY-top-left.png | Bin 0 -> 3025 bytes .../doc/images/flickable-contentXY-top-left.svgz | Bin 0 -> 1550 bytes .../doc/images/flickable-contentXY-top-right.png | Bin 0 -> 2866 bytes .../doc/images/flickable-contentXY-top-right.svgz | Bin 0 -> 1594 bytes src/quick/items/qquickflickable.cpp | 27 ++++++++++++++++++++- 11 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/quick/doc/images/flickable-contentXY-bottom-left.png create mode 100644 src/quick/doc/images/flickable-contentXY-bottom-left.svgz create mode 100644 src/quick/doc/images/flickable-contentXY-bottom-right.png create mode 100644 src/quick/doc/images/flickable-contentXY-bottom-right.svgz create mode 100644 src/quick/doc/images/flickable-contentXY-resting.png create mode 100644 src/quick/doc/images/flickable-contentXY-resting.svgz create mode 100644 src/quick/doc/images/flickable-contentXY-top-left.png create mode 100644 src/quick/doc/images/flickable-contentXY-top-left.svgz create mode 100644 src/quick/doc/images/flickable-contentXY-top-right.png create mode 100644 src/quick/doc/images/flickable-contentXY-top-right.svgz (limited to 'src') diff --git a/src/quick/doc/images/flickable-contentXY-bottom-left.png b/src/quick/doc/images/flickable-contentXY-bottom-left.png new file mode 100644 index 0000000000..47d3be4625 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-bottom-left.png differ diff --git a/src/quick/doc/images/flickable-contentXY-bottom-left.svgz b/src/quick/doc/images/flickable-contentXY-bottom-left.svgz new file mode 100644 index 0000000000..db86262d74 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-bottom-left.svgz differ diff --git a/src/quick/doc/images/flickable-contentXY-bottom-right.png b/src/quick/doc/images/flickable-contentXY-bottom-right.png new file mode 100644 index 0000000000..eb9eff24c5 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-bottom-right.png differ diff --git a/src/quick/doc/images/flickable-contentXY-bottom-right.svgz b/src/quick/doc/images/flickable-contentXY-bottom-right.svgz new file mode 100644 index 0000000000..088c1bdf1e Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-bottom-right.svgz differ diff --git a/src/quick/doc/images/flickable-contentXY-resting.png b/src/quick/doc/images/flickable-contentXY-resting.png new file mode 100644 index 0000000000..11bde53da5 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-resting.png differ diff --git a/src/quick/doc/images/flickable-contentXY-resting.svgz b/src/quick/doc/images/flickable-contentXY-resting.svgz new file mode 100644 index 0000000000..c8ac118048 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-resting.svgz differ diff --git a/src/quick/doc/images/flickable-contentXY-top-left.png b/src/quick/doc/images/flickable-contentXY-top-left.png new file mode 100644 index 0000000000..de3d11d283 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-top-left.png differ diff --git a/src/quick/doc/images/flickable-contentXY-top-left.svgz b/src/quick/doc/images/flickable-contentXY-top-left.svgz new file mode 100644 index 0000000000..bcb6476cd2 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-top-left.svgz differ diff --git a/src/quick/doc/images/flickable-contentXY-top-right.png b/src/quick/doc/images/flickable-contentXY-top-right.png new file mode 100644 index 0000000000..7f4a16bde1 Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-top-right.png differ diff --git a/src/quick/doc/images/flickable-contentXY-top-right.svgz b/src/quick/doc/images/flickable-contentXY-top-right.svgz new file mode 100644 index 0000000000..32b721cb6b Binary files /dev/null and b/src/quick/doc/images/flickable-contentXY-top-right.svgz differ diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index d892e3b490..cc35630fff 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -632,6 +632,31 @@ void QQuickFlickablePrivate::updateBeginningEnd() \c contentItem that are relevant. For example, the bound of Items added to the Flickable will be available by \c contentItem.childrenRect + \section1 Examples of contentX and contentY + + The following images demonstrate a flickable being flicked in various + directions and the resulting \l contentX and \l contentY values. + The blue square represents the flickable's content, and the black + border represents the bounds of the flickable. + + \table + \row + \li \image flickable-contentXY-resting.png + \li The \c contentX and \c contentY are both \c 0. + \row + \li \image flickable-contentXY-top-left.png + \li The \c contentX and the \c contentY are both \c 50. + \row + \li \image flickable-contentXY-top-right.png + \li The \c contentX is \c -50 and the \c contentY is \c 50. + \row + \li \image flickable-contentXY-bottom-right.png + \li The \c contentX and the \c contentY are both \c -50. + \row + \li \image flickable-contentXY-bottom-left.png + \li The \c contentX is \c 50 and the \c contentY is \c -50. + \endtable + \section1 Limitations \note Due to an implementation detail, items placed inside a Flickable @@ -737,7 +762,7 @@ QQuickFlickable::~QQuickFlickable() for the position; another way is to use the normalized values in \l {QtQuick::Flickable::visibleArea}{visibleArea}. - \sa originX, originY + \sa {Examples of contentX and contentY}, originX, originY */ qreal QQuickFlickable::contentX() const { -- cgit v1.2.3