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
qpaintdevice.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qpaintdevice.h"
5
7
9{
10 painters = 0;
11}
12
14{
15 if (paintingActive())
16 qWarning("QPaintDevice: Cannot destroy paint device that is being "
17 "painted");
18}
19
20
25{
26}
27
32{
33 return nullptr;
34}
35
40{
41 return nullptr;
42}
43
45{
46 return device->metric(metric);
47}
48
50{
51 // Fallback: A subclass has not implemented PdmDevicePixelRatioScaled but might
52 // have implemented PdmDevicePixelRatio.
55
56 qWarning("QPaintDevice::metrics: Device has no metric information");
57
58 if (m == PdmDpiX) {
59 return 72;
60 } else if (m == PdmDpiY) {
61 return 72;
62 } else if (m == PdmNumColors) {
63 // FIXME: does this need to be a real value?
64 return 256;
65 } else if (m == PdmDevicePixelRatio) {
66 return 1;
67 } else {
68 qDebug("Unrecognised metric %d!",m);
69 return 0;
70 }
71}
72
IOBluetoothDevice * device
bool paintingActive() const
QPaintDevice() noexcept
virtual void initPainter(QPainter *painter) const
@ PdmDevicePixelRatioScaled
virtual ~QPaintDevice()
ushort painters
virtual QPaintDevice * redirected(QPoint *offset) const
virtual QPainter * sharedPainter() const
virtual int metric(PaintDeviceMetric metric) const
static qreal devicePixelRatioFScale()
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qpoint.h:25
Combined button and popup list for selecting options.
#define qDebug
[1]
Definition qlogging.h:164
#define qWarning
Definition qlogging.h:166
const GLfloat * m
Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)