OpenCoverage

qquickpainteditem.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickpainteditem.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
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 https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://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 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QQUICKPAINTEDITEM_P_H-
41#define QQUICKPAINTEDITEM_P_H-
42-
43#include <QtQuick/qquickitem.h>-
44#include <QtGui/qcolor.h>-
45-
46QT_BEGIN_NAMESPACE-
47-
48class QQuickPaintedItemPrivate;-
49class Q_QUICK_EXPORT QQuickPaintedItem : public QQuickItem-
50{-
51 Q_OBJECT-
52-
53 Q_PROPERTY(QSize contentsSize READ contentsSize WRITE setContentsSize NOTIFY contentsSizeChanged)-
54 Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged)-
55 Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)-
56 Q_PROPERTY(RenderTarget renderTarget READ renderTarget WRITE setRenderTarget NOTIFY renderTargetChanged)-
57 Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged)-
58-
59public:-
60 explicit QQuickPaintedItem(QQuickItem *parent = nullptr);-
61 ~QQuickPaintedItem() override;-
62-
63 enum RenderTarget {-
64 Image,-
65 FramebufferObject,-
66 InvertedYFramebufferObject-
67 };-
68 Q_ENUM(RenderTarget)-
69-
70 enum PerformanceHint {-
71 FastFBOResizing = 0x1-
72 };-
73 Q_DECLARE_FLAGS(PerformanceHints, PerformanceHint)-
74-
75 void update(const QRect &rect = QRect());-
76-
77 bool opaquePainting() const;-
78 void setOpaquePainting(bool opaque);-
79-
80 bool antialiasing() const;-
81 void setAntialiasing(bool enable);-
82-
83 bool mipmap() const;-
84 void setMipmap(bool enable);-
85-
86 PerformanceHints performanceHints() const;-
87 void setPerformanceHint(PerformanceHint hint, bool enabled = true);-
88 void setPerformanceHints(PerformanceHints hints);-
89-
90 QRectF contentsBoundingRect() const;-
91-
92 QSize contentsSize() const;-
93 void setContentsSize(const QSize &);-
94 void resetContentsSize();-
95-
96 qreal contentsScale() const;-
97 void setContentsScale(qreal);-
98-
99 QSize textureSize() const;-
100 void setTextureSize(const QSize &size);-
101-
102 QColor fillColor() const;-
103 void setFillColor(const QColor&);-
104-
105 RenderTarget renderTarget() const;-
106 void setRenderTarget(RenderTarget target);-
107-
108 virtual void paint(QPainter *painter) = 0;-
109-
110 bool isTextureProvider() const override;-
111 QSGTextureProvider *textureProvider() const override;-
112-
113Q_SIGNALS:-
114 void fillColorChanged();-
115 void contentsSizeChanged();-
116 void contentsScaleChanged();-
117 void renderTargetChanged();-
118 void textureSizeChanged();-
119-
120protected:-
121 QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = nullptr);-
122 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;-
123 void releaseResources() override;-
124 void itemChange(ItemChange, const ItemChangeData &) override;-
125-
126private Q_SLOTS:-
127 void invalidateSceneGraph();-
128-
129private:-
130 Q_DISABLE_COPY(QQuickPaintedItem)-
131 Q_DECLARE_PRIVATE(QQuickPaintedItem)
executed 202 times by 1 test: return reinterpret_cast<QQuickPaintedItemPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickpainteditem
executed 160 times by 1 test: return reinterpret_cast<const QQuickPaintedItemPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickpainteditem
160-202
132};-
133-
134Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPaintedItem::PerformanceHints)-
135-
136QT_END_NAMESPACE-
137-
138#endif // QQUICKPAINTEDITEM_P_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0