The quickest solution would be to create a QImage , manage it (set pixels), and then get Qt to draw it.
The QImage class is designed for quick I / O, from the manual:
The QImage class provides a device-independent image representation that provides direct access to pixel data and can be used as a drawing device.
The QImage class supports several image formats described in the Format enumeration. These include monochrome, 8-bit, 32-bit and alpha-mixed images, which are available in all versions of Qt 4.x.
The detailed description section contains information on manipulating pixels.
To display it, the easiest way would be to convert it to pixmap using QPixmap::fromImage and then put it in the label using QLabel::setPixmap .
For more control, you can subclass QWidget , overload paintEvent and draw a QImage using QPainter using QPainter::drawImage .
Silas parker
source share