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
doc_src_groups.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
6{
7 detach(); // detach from common data
8 d->style = style; // set the style member
9}
10
11void QPen::detach()
12{
13 if (d->ref != 1) {
14 ... // perform a deep copy
15 }
16}
18
19
22p1.load("image.bmp");
23p2 = p1; // p1 and p2 share data
24
26paint.begin(&p2); // cuts p2 loose from p1
27paint.drawText(0,50, "Hi");
28paint.end();
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 drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
bool end()
Ends painting.
Qt::PenStyle style
Definition qpen_p.h:30
void setStyle(Qt::PenStyle)
[0]
Qt::PenStyle style() const
Returns the pen style.
Definition qpen.cpp:366
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
bool load(const QString &fileName, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the file with the given fileName.
Definition qpixmap.cpp:704
QAtomicInt ref
Definition qshareddata.h:21
QPixmap p2
QPainter paint
QPixmap p1
[0]