Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to return pixels from QPixmap to QML

$
0
0
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

Viewing all articles
Browse latest Browse all 4972

Trending Articles