Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickimagebase_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
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 QQUICKIMAGEBASE_P_H | - |
41 | #define QQUICKIMAGEBASE_P_H | - |
42 | - | |
43 | // | - |
44 | // W A R N I N G | - |
45 | // ------------- | - |
46 | // | - |
47 | // This file is not part of the Qt API. It exists purely as an | - |
48 | // implementation detail. This header file may change from version to | - |
49 | // version without notice, or even be removed. | - |
50 | // | - |
51 | // We mean it. | - |
52 | // | - |
53 | - | |
54 | #include "qquickimplicitsizeitem_p.h" | - |
55 | #include <private/qtquickglobal_p.h> | - |
56 | - | |
57 | QT_BEGIN_NAMESPACE | - |
58 | - | |
59 | class QQuickImageBasePrivate; | - |
60 | class Q_QUICK_PRIVATE_EXPORT QQuickImageBase : public QQuickImplicitSizeItem | - |
61 | { | - |
62 | Q_OBJECT | - |
63 | - | |
64 | Q_PROPERTY(Status status READ status NOTIFY statusChanged) | - |
65 | Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) | - |
66 | Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) | - |
67 | Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged) | - |
68 | Q_PROPERTY(bool cache READ cache WRITE setCache NOTIFY cacheChanged) | - |
69 | Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize RESET resetSourceSize NOTIFY sourceSizeChanged) | - |
70 | Q_PROPERTY(bool mirror READ mirror WRITE setMirror NOTIFY mirrorChanged) | - |
71 | - | |
72 | public: | - |
73 | QQuickImageBase(QQuickItem *parent=nullptr); | - |
74 | ~QQuickImageBase(); | - |
75 | enum Status { Null, Ready, Loading, Error }; | - |
76 | Q_ENUM(Status) | - |
77 | Status status() const; | - |
78 | qreal progress() const; | - |
79 | - | |
80 | QUrl source() const; | - |
81 | virtual void setSource(const QUrl &url); | - |
82 | - | |
83 | bool asynchronous() const; | - |
84 | void setAsynchronous(bool); | - |
85 | - | |
86 | bool cache() const; | - |
87 | void setCache(bool); | - |
88 | - | |
89 | QImage image() const; | - |
90 | - | |
91 | virtual void setSourceSize(const QSize&); | - |
92 | QSize sourceSize() const; | - |
93 | void resetSourceSize(); | - |
94 | - | |
95 | virtual void setMirror(bool mirror); | - |
96 | bool mirror() const; | - |
97 | - | |
98 | virtual void setAutoTransform(bool transform); | - |
99 | bool autoTransform() const; | - |
100 | - | |
101 | static void resolve2xLocalFile(const QUrl &url, qreal targetDevicePixelRatio, QUrl *sourceUrl, qreal *sourceDevicePixelRatio); | - |
102 | - | |
103 | // Use a virtual rather than a signal->signal to avoid the huge | - |
104 | // connect/conneciton overhead for this rare case. | - |
105 | virtual void emitAutoTransformBaseChanged() { } | - |
106 | - | |
107 | Q_SIGNALS: | - |
108 | void sourceChanged(const QUrl &); | - |
109 | void sourceSizeChanged(); | - |
110 | void statusChanged(QQuickImageBase::Status); | - |
111 | void progressChanged(qreal progress); | - |
112 | void asynchronousChanged(); | - |
113 | void cacheChanged(); | - |
114 | void mirrorChanged(); | - |
115 | - | |
116 | protected: | - |
117 | virtual void load(); | - |
118 | void componentComplete() override; | - |
119 | virtual void pixmapChange(); | - |
120 | void itemChange(ItemChange change, const ItemChangeData &value) override; | - |
121 | QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent); | - |
122 | - | |
123 | private Q_SLOTS: | - |
124 | virtual void requestFinished(); | - |
125 | void requestProgress(qint64,qint64); | - |
126 | - | |
127 | private: | - |
128 | Q_DISABLE_COPY(QQuickImageBase) | - |
129 | Q_DECLARE_PRIVATE(QQuickImageBase) executed 76562 times by 15 tests: return reinterpret_cast<QQuickImageBasePrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 18806 times by 12 tests: return reinterpret_cast<const QQuickImageBasePrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 18806-76562 |
130 | }; | - |
131 | - | |
132 | QT_END_NAMESPACE | - |
133 | - | |
134 | #endif // QQUICKIMAGEBASE_P_H | - |
Source code | Switch to Preprocessed file |