diff options
Diffstat (limited to 'src/quick/items/qquickborderimage.cpp')
-rw-r--r-- | src/quick/items/qquickborderimage.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index b840328184..462a44634e 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -327,7 +327,7 @@ void QQuickBorderImage::load() QNetworkRequest req(d->url); d->sciReply = qmlEngine(this)->networkAccessManager()->get(req); qmlobject_connect(d->sciReply, QNetworkReply, SIGNAL(finished()), - this, QQuickBorderImage, SLOT(sciRequestFinished())) + this, QQuickBorderImage, SLOT(sciRequestFinished())); #endif } } else { @@ -343,7 +343,7 @@ void QQuickBorderImage::load() QUrl loadUrl = d->url; resolve2xLocalFile(d->url, targetDevicePixelRatio, &loadUrl, &d->devicePixelRatio); - d->pix.load(qmlEngine(this), loadUrl, d->sourcesize * d->devicePixelRatio, options); + d->pix.load(qmlEngine(this), loadUrl, d->sourcesize * d->devicePixelRatio, options, QQuickImageProviderOptions(), d->currentFrame, d->frameCount); if (d->pix.isLoading()) { if (d->progress != 0.0) { @@ -534,6 +534,10 @@ void QQuickBorderImage::requestFinished() d->oldSourceSize = sourceSize(); emit sourceSizeChanged(); } + if (d->frameCount != d->pix.frameCount()) { + d->frameCount = d->pix.frameCount(); + emit frameCountChanged(); + } pixmapChange(); } @@ -647,7 +651,7 @@ QSGNode *QQuickBorderImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat bool updatePixmap = d->pixmapChanged; d->pixmapChanged = false; if (!node) { - node = d->sceneGraphContext()->createInternalImageNode(); + node = d->sceneGraphContext()->createInternalImageNode(d->sceneGraphRenderContext()); updatePixmap = true; } @@ -693,6 +697,18 @@ void QQuickBorderImage::pixmapChange() update(); } +/*! + \qmlproperty int QtQuick::BorderImage::currentFrame + \qmlproperty int QtQuick::BorderImage::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 #include "moc_qquickborderimage_p.cpp" |