Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.1
-
None
-
85ed63f825da57103c68f73af5adeebf67db0da9
Description
WebP animations stop running after the first loop, because QWebpHandler::canRead() returns true even if there are no more frames to read. Thus, QMovie attempts to read the next frame when it should jump back to the first frame, ends up reading a null-image, and the animation is interrupted.
Qt Widgets:
#include <QtWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel label; label.resize(300, 300); label.setAlignment(Qt::AlignCenter); label.setMovie(new QMovie("path/to/busyindicator.webp")); label.movie()->start(); label.show(); return app.exec(); }
Qt Quick:
import QtQuick 2.9 import QtQuick.Window 2.2 Window { width: 300 height: 300 visible: true AnimatedImage { anchors.centerIn: parent source: "file:///path/to/busyindicator.webp" } }