Convert images into videos and display them in QML
-
Hi,
That something that would be simpler to do server side.
-
Server can retur me only images. I create class
class ImageProvider : public QQuickImageProvider { public: ImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap) { } QPixmap m_pixmap = QPixmap("/home/owner/Загрузки/image_2022-02-04_15-52-48.png"); QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override { return m_pixmap; } };
and set in main.cpp
engine.addImageProvider(QLatin1String("imageProviderIRImage"), appCore->m_imageProviderIRImage);
And set source image in qml
source: "image://imageProviderIRImage"
But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?
-
Server can retur me only images. I create class
class ImageProvider : public QQuickImageProvider { public: ImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap) { } QPixmap m_pixmap = QPixmap("/home/owner/Загрузки/image_2022-02-04_15-52-48.png"); QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override { return m_pixmap; } };
and set in main.cpp
engine.addImageProvider(QLatin1String("imageProviderIRImage"), appCore->m_imageProviderIRImage);
And set source image in qml
source: "image://imageProviderIRImage"
But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?
@Mihaill said in Convert images into videos and display them in QML:
But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?
Why should image be reloaded with this code?
The image in loaded once byImageProvider
and in QML the link is static, so once image is loaded there is no reason to request image again.