diff options
Diffstat (limited to 'src/gui/doc/snippets/picture/picture.cpp')
| -rw-r--r-- | src/gui/doc/snippets/picture/picture.cpp | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/gui/doc/snippets/picture/picture.cpp b/src/gui/doc/snippets/picture/picture.cpp index 807c263b19..cdf0dda84b 100644 --- a/src/gui/doc/snippets/picture/picture.cpp +++ b/src/gui/doc/snippets/picture/picture.cpp @@ -47,36 +47,34 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include <QtWidgets> -void myProcessing(const QString &) -{ -} - -int main() +namespace picture { +void wrapper0() { - QWidget myWidget; - { - // RECORD //! [0] - QPicture picture; - QPainter painter; - painter.begin(&picture); // paint in picture - painter.drawEllipse(10,20, 80,70); // draw an ellipse - painter.end(); // painting done - picture.save("drawing.pic"); // save picture +QPicture picture; +QPainter painter; +painter.begin(&picture); // paint in picture +painter.drawEllipse(10,20, 80,70); // draw an ellipse +painter.end(); // painting done +picture.save("drawing.pic"); // save picture //! [0] - } - { - // REPLAY +} // wrapper0 + + +void wrapper1() { +QImage myImage; + //! [1] - QPicture picture; - picture.load("drawing.pic"); // load picture - QPainter painter; - painter.begin(&myImage); // paint in myImage - painter.drawPicture(0, 0, picture); // draw the picture at (0,0) - painter.end(); // painting done +QPicture picture; +picture.load("drawing.pic"); // load picture +QPainter painter; +painter.begin(&myImage); // paint in myImage +painter.drawPicture(0, 0, picture); // draw the picture at (0,0) +painter.end(); // painting done //! [1] - } + +} // wrapper1 +} // picture |
