Replaying a QPicture, coordinate transformations

  • When I draw something in a QPicture, like in the "example in the documentation":
    @ QPicture picture;
    QPainter painter;
    painter.begin(&picture); // paint in picture
    painter.drawEllipse(10,20, 80,70); // draw an ellipse
    painter.end(); // painting done@

    and then replay it on another target, can I apply coordinate transformations before replaying the picture (like in the following), and will they have effect?

    @ painter.begin(&myImage); // paint in myImage
    painter.drawPicture(0, 0, picture); // draw the picture at (0,0)
    painter.end(); // painting done@

    Besides, what is the performance impact of storing draw commands in a QPicture? Does someone have experience here?

    Best regards,


  • OK, I tried it out.

    Yes, coordinate transformations are applied. Yes, it is at least much faster than our code that initially creates the paint commands.



Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.