Qt 6.11 is out! See what's new in the release
blog
How to return pixels from QPixmap to QML
QML and Qt Quick
1
Posts
1
Posters
1.1k
Views
1
Watching
-
How would one return Image bits to QML from C++?
I have this code in c++:
@
QImage image = m_pixmap.copy(sx, sy, sw, sh).toImage();image = image.convertToFormat(QImage::Format_ARGB32);
QByteArray bytes((char *) image.bits(), image.byteCount());return ?????
@How would I package up the QByteArray and return the data to QML? I tried to return as a QVariant but got errors.
Thanks