Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
picture.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QtWidgets>
4
5namespace picture {
6void wrapper0()
7{
11painter.begin(&picture); // paint in picture
12painter.drawEllipse(10,20, 80,70); // draw an ellipse
13painter.end(); // painting done
14picture.save("drawing.pic"); // save picture
16
17} // wrapper0
18
19
20void wrapper1() {
21QImage myImage;
22
25picture.load("drawing.pic"); // load picture
27painter.begin(&myImage); // paint in myImage
28painter.drawPicture(0, 0, picture); // draw the picture at (0,0)
29painter.end(); // painting done
31
32} // wrapper1
33} // picture
\inmodule QtGui
Definition qimage.h:37
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
bool end()
Ends painting.
void drawPicture(const QPointF &p, const QPicture &picture)
Replays the given picture at the given point.
The QPicture class is a paint device that records and replays QPainter commands.
Definition qpicture.h:19
void wrapper1()
Definition picture.cpp:20
void wrapper0()
Definition picture.cpp:6
QPainter painter(this)
[7]