qpaintdevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintdevice.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qpaintdevice.h"-
35-
36QT_BEGIN_NAMESPACE-
37-
38QPaintDevice::QPaintDevice() Q_DECL_NOEXCEPT-
39{-
40 reserved = 0;-
41 painters = 0;-
42}
never executed: end of block
0
43-
44QPaintDevice::~QPaintDevice()-
45{-
46 if (paintingActive())
paintingActive()Description
TRUEnever evaluated
FALSEnever evaluated
0
47 qWarning("QPaintDevice: Cannot destroy paint device that is being "
never executed: QMessageLogger(__FILE__, 47, __PRETTY_FUNCTION__).warning("QPaintDevice: Cannot destroy paint device that is being " "painted");
0
48 "painted");
never executed: QMessageLogger(__FILE__, 47, __PRETTY_FUNCTION__).warning("QPaintDevice: Cannot destroy paint device that is being " "painted");
0
49}
never executed: end of block
0
50-
51-
52/*!-
53 \internal-
54*/-
55void QPaintDevice::initPainter(QPainter *) const-
56{-
57}-
58-
59/*!-
60 \internal-
61*/-
62QPaintDevice *QPaintDevice::redirected(QPoint *) const-
63{-
64 return 0;
never executed: return 0;
0
65}-
66-
67/*!-
68 \internal-
69*/-
70QPainter *QPaintDevice::sharedPainter() const-
71{-
72 return 0;
never executed: return 0;
0
73}-
74-
75Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)-
76{-
77 return device->metric(metric);
never executed: return device->metric(metric);
0
78}-
79-
80int QPaintDevice::metric(PaintDeviceMetric m) const-
81{-
82 // Fallback: A subclass has not implemented PdmDevicePixelRatioScaled but might-
83 // have implemented PdmDevicePixelRatio.-
84 if (m == PdmDevicePixelRatioScaled)
m == PdmDevicePixelRatioScaledDescription
TRUEnever evaluated
FALSEnever evaluated
0
85 return this->metric(PdmDevicePixelRatio) * devicePixelRatioFScale();
never executed: return this->metric(PdmDevicePixelRatio) * devicePixelRatioFScale();
0
86-
87 qWarning("QPaintDevice::metrics: Device has no metric information");-
88-
89 if (m == PdmDpiX) {
m == PdmDpiXDescription
TRUEnever evaluated
FALSEnever evaluated
0
90 return 72;
never executed: return 72;
0
91 } else if (m == PdmDpiY) {
m == PdmDpiYDescription
TRUEnever evaluated
FALSEnever evaluated
0
92 return 72;
never executed: return 72;
0
93 } else if (m == PdmNumColors) {
m == PdmNumColorsDescription
TRUEnever evaluated
FALSEnever evaluated
0
94 // FIXME: does this need to be a real value?-
95 return 256;
never executed: return 256;
0
96 } else if (m == PdmDevicePixelRatio) {
m == PdmDevicePixelRatioDescription
TRUEnever evaluated
FALSEnever evaluated
0
97 return 1;
never executed: return 1;
0
98 } else {-
99 qDebug("Unrecognised metric %d!",m);-
100 return 0;
never executed: return 0;
0
101 }-
102}-
103-
104QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9