Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.2.2
-
None
Description
Currently it is not possible to append to a QPicture.
Anytime you call begin on a QPicture painter, it destroys all the old data. The only way to add to a QPicture currently is to create a new QPicture, play the existing QPicture that you want to append to, then paint the new data. This is slow and inefficient.
The problem can be demonstrated using the following code:
#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPicture pixmap;
QPainter painter3;
painter3.begin((QPaintDevice *) &pixmap);
QLineF line3(5.0, 60.0, 30.0, 10.0);
painter3.drawLine(line3);
painter3.end();
QPixmap pix(100,100);
QPainter pixpainter(&pix);
pixpainter.drawPicture(0, 0, pixmap);
QLabel label;
label.setPixmap ( pix);
label.show();
return app.exec();
}