diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-05 11:08:59 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-05 11:08:59 +0200 |
commit | 2746518c76e02c642ff29faf568de4de90216e58 (patch) | |
tree | 822a6d979c13b6450c221b2a45ccfb6674bcb8e4 /src/quick/items/qquickimage.cpp | |
parent | 9e32b23a1514f367921b4a9ee25bc864a008463c (diff) | |
parent | bdf0a46c289298f7378796d62ae5fb283e08657d (diff) | |
download | qtdeclarative-wip/qt6.tar.gz |
Merge remote-tracking branch 'origin/dev' into wip/qt6wip/qt6
Conflicts:
.qmake.conf
src/qml/qml/qqmlengine.cpp
src/qmlmodels/qqmlmodelsmodule.cpp
Change-Id: Id60420f8250a9c97fcfe56d4eea19b62c6870404
Diffstat (limited to 'src/quick/items/qquickimage.cpp')
-rw-r--r-- | src/quick/items/qquickimage.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index dfbe271606..c7e7ccea55 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -687,7 +687,6 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) yOffset = qCeil(height() - pixHeight); switch (d->fillMode) { - default: case Stretch: targetRect = QRectF(0, 0, width(), height()); sourceRect = d->pix.rect(); @@ -699,7 +698,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) break; case PreserveAspectCrop: { - targetRect = QRect(0, 0, width(), height()); + targetRect = QRectF(0, 0, width(), height()); qreal wscale = width() / qreal(d->pix.width()); qreal hscale = height() / qreal(d->pix.height()); @@ -751,7 +750,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) targetRect = QRectF(x + xOffset, y + yOffset, w, h); sourceRect = QRectF(x, y, w, h); break; - }; + } qreal nsWidth = (hWrap == QSGTexture::Repeat || d->fillMode == Pad) ? d->pix.width() / d->devicePixelRatio : d->pix.width(); qreal nsHeight = (vWrap == QSGTexture::Repeat || d->fillMode == Pad) ? d->pix.height() / d->devicePixelRatio : d->pix.height(); @@ -889,4 +888,16 @@ void QQuickImage::setMipmap(bool use) By default, this property is set to false. */ +/*! + \qmlproperty int QtQuick::Image::currentFrame + \qmlproperty int QtQuick::Image::frameCount + \since 5.14 + + currentFrame is the frame that is currently visible. The default is \c 0. + You can set it to a number between \c 0 and \c {frameCount - 1} to display a + different frame, if the image contains multiple frames. + + frameCount is the number of frames in the image. Most images have only one frame. +*/ + QT_END_NAMESPACE |