OpenCoverage

qquickimageprovider.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickimageprovider.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QQuickTextureFactory::QQuickTextureFactory()-
5{-
6}-
7-
8-
9-
10-
11-
12QQuickTextureFactory::~QQuickTextureFactory()-
13{-
14}-
15QImage QQuickTextureFactory::image() const-
16{-
17 return
never executed: return QImage();
QImage();
never executed: return QImage();
0
18}-
19QQuickTextureFactory *QQuickTextureFactory::textureFactoryForImage(const QImage &image)-
20{-
21 if (image.isNull()
image.isNull()Description
TRUEevaluated 22 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_qquicktextedit
FALSEevaluated 8874 times by 37 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
)
22-8874
22 return
executed 22 times by 6 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_qquicktextedit
nullptr;
executed 22 times by 6 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_qquicktextedit
22
23 QQuickTextureFactory *texture = QSGContext::createTextureFactoryFromImage(image);-
24 if (texture
textureDescription
TRUEnever evaluated
FALSEevaluated 8874 times by 37 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
)
0-8874
25 return
never executed: return texture;
texture;
never executed: return texture;
0
26 return
executed 8874 times by 37 tests: return new QQuickDefaultTextureFactory(image);
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
new QQuickDefaultTextureFactory(image);
executed 8874 times by 37 tests: return new QQuickDefaultTextureFactory(image);
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
8874
27}-
28QQuickImageResponse::QQuickImageResponse()-
29 : QObject(*(new QQuickImageResponsePrivate))-
30{-
31 { QQuickImageResponse *sender = (this); QQuickImageResponse *receiver = (this); const char *signal = (qFlagLocation("2""finished()" "\0" __FILE__ ":" "168")); const char *method = (qFlagLocation("1""_q_finished()" "\0" __FILE__ ":" "168")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
2-14
32 __FILE__-
33 ,-
34 168-
35 )); signalIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(signal+1); }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickimageprovider
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
2-14
36 __FILE__-
37 ,-
38 168-
39 )); if (code == 1
code == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
FALSEnever evaluated
) methodIdx = QQuickImageResponse::staticMetaObject.indexOfSlot(method+1);
executed 2 times by 1 test: methodIdx = QQuickImageResponse::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_qquickimageprovider
else methodIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-2
40 __FILE__-
41 ,-
42 168-
43 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }-
44 ;-
45}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickimageprovider
16
46-
47-
48-
49-
50QQuickImageResponse::~QQuickImageResponse()-
51{-
52}-
53-
54-
55-
56-
57QString QQuickImageResponse::errorString() const-
58{-
59 return
executed 16 times by 1 test: return QString();
Executed by:
  • tst_qquickimageprovider
QString();
executed 16 times by 1 test: return QString();
Executed by:
  • tst_qquickimageprovider
16
60}-
61void QQuickImageResponse::cancel()-
62{-
63}-
64QQuickImageProvider::QQuickImageProvider(ImageType type, Flags flags)-
65 : d(new QQuickImageProviderPrivate)-
66{-
67 d->type = type;-
68 d->flags = flags;-
69 d->isProviderWithOptions = false;-
70}
executed 116 times by 5 tests: end of block
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
116
71-
72-
73-
74-
75-
76-
77QQuickImageProvider::~QQuickImageProvider()-
78{-
79 delete d;-
80}
executed 116 times by 5 tests: end of block
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
116
81-
82-
83-
84-
85QQuickImageProvider::ImageType QQuickImageProvider::imageType() const-
86{-
87 return
executed 8116 times by 5 tests: return d->type;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
d->type;
executed 8116 times by 5 tests: return d->type;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
8116
88}-
89-
90-
91-
92-
93QQuickImageProvider::Flags QQuickImageProvider::flags() const-
94{-
95 return
executed 8182 times by 5 tests: return d->flags;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
d->flags;
executed 8182 times by 5 tests: return d->flags;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
8182
96}-
97QImage QQuickImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize)-
98{-
99 (void)id;;-
100 (void)size;;-
101 (void)requestedSize;;-
102 if (d->type == Image
d->type == ImageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
103 QMessageLogger(__FILE__, 405, __PRETTY_FUNCTION__).warning("ImageProvider supports Image type but has not implemented requestImage()");
never executed: QMessageLogger(__FILE__, 405, __PRETTY_FUNCTION__).warning("ImageProvider supports Image type but has not implemented requestImage()");
0
104 return
never executed: return QImage();
QImage();
never executed: return QImage();
0
105}-
106QPixmap QQuickImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)-
107{-
108 (void)id;;-
109 (void)size;;-
110 (void)requestedSize;;-
111 if (d->type == Pixmap
d->type == PixmapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
112 QMessageLogger(__FILE__, 434, __PRETTY_FUNCTION__).warning("ImageProvider supports Pixmap type but has not implemented requestPixmap()");
never executed: QMessageLogger(__FILE__, 434, __PRETTY_FUNCTION__).warning("ImageProvider supports Pixmap type but has not implemented requestPixmap()");
0
113 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
114}-
115QQuickTextureFactory *QQuickImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)-
116{-
117 (void)id;;-
118 (void)size;;-
119 (void)requestedSize;;-
120 if (d->type == Texture
d->type == TextureDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
121 QMessageLogger(__FILE__, 465, __PRETTY_FUNCTION__).warning("ImageProvider supports Texture type but has not implemented requestTexture()");
never executed: QMessageLogger(__FILE__, 465, __PRETTY_FUNCTION__).warning("ImageProvider supports Texture type but has not implemented requestTexture()");
0
122 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
123}-
124QQuickAsyncImageProvider::QQuickAsyncImageProvider()-
125 : QQuickImageProvider(ImageResponse, ForceAsynchronousImageLoading)-
126 , d(nullptr)-
127{-
128 (void)d;;-
129}
executed 20 times by 2 tests: end of block
Executed by:
  • tst_qquickimageprovider
  • tst_sharedimage
20
130-
131QQuickAsyncImageProvider::~QQuickAsyncImageProvider()-
132{-
133}-
134class QQuickImageProviderOptionsPrivate : public QSharedData-
135{-
136public:-
137 QQuickImageProviderOptionsPrivate()-
138 {-
139 }-
140-
141 QQuickImageProviderOptions::AutoTransform autoTransform = QQuickImageProviderOptions::UsePluginDefaultTransform;-
142 bool preserveAspectRatioCrop = false;-
143 bool preserveAspectRatioFit = false;-
144};-
145QQuickImageProviderOptions::QQuickImageProviderOptions()-
146 : d(new QQuickImageProviderOptionsPrivate())-
147{-
148}
executed 16891 times by 42 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlinfo
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • ...
16891
149-
150QQuickImageProviderOptions::~QQuickImageProviderOptions()-
151{-
152}-
153-
154QQuickImageProviderOptions::QQuickImageProviderOptions(const QQuickImageProviderOptions &other)-
155 : d(other.d)-
156{-
157}
executed 63745 times by 40 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
63745
158-
159QQuickImageProviderOptions& QQuickImageProviderOptions::operator=(const QQuickImageProviderOptions &other)-
160{-
161 d = other.d;-
162 return
executed 16 times by 1 test: return *this;
Executed by:
  • tst_sharedimage
*this;
executed 16 times by 1 test: return *this;
Executed by:
  • tst_sharedimage
16
163}-
164-
165bool QQuickImageProviderOptions::operator==(const QQuickImageProviderOptions &other) const-
166{-
167 return
executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
d->autoTransform == other.d->autoTransform &&
executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
16503
168 d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop &&
executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
16503
169 d->preserveAspectRatioFit == other.d->preserveAspectRatioFit;
executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
16503
170}-
171-
172-
173-
174-
175QQuickImageProviderOptions::AutoTransform QQuickImageProviderOptions::autoTransform() const-
176{-
177 return
executed 45645 times by 40 tests: return d->autoTransform;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
d->autoTransform;
executed 45645 times by 40 tests: return d->autoTransform;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • ...
45645
178}-
179-
180void QQuickImageProviderOptions::setAutoTransform(QQuickImageProviderOptions::AutoTransform autoTransform)-
181{-
182 d->autoTransform = autoTransform;-
183}
never executed: end of block
0
184-
185-
186-
187-
188-
189bool QQuickImageProviderOptions::preserveAspectRatioCrop() const-
190{-
191 return
executed 152 times by 5 tests: return d->preserveAspectRatioCrop;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
d->preserveAspectRatioCrop;
executed 152 times by 5 tests: return d->preserveAspectRatioCrop;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
152
192}-
193-
194void QQuickImageProviderOptions::setPreserveAspectRatioCrop(bool preserveAspectRatioCrop)-
195{-
196 d->preserveAspectRatioCrop = preserveAspectRatioCrop;-
197}
executed 26 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickimage
26
198-
199-
200-
201-
202-
203bool QQuickImageProviderOptions::preserveAspectRatioFit() const-
204{-
205 return
executed 126 times by 5 tests: return d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
d->preserveAspectRatioFit;
executed 126 times by 5 tests: return d->preserveAspectRatioFit;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
126
206}-
207-
208void QQuickImageProviderOptions::setPreserveAspectRatioFit(bool preserveAspectRatioFit)-
209{-
210 d->preserveAspectRatioFit = preserveAspectRatioFit;-
211}
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qquickimage
  • tst_sharedimage
28
212-
213QQuickImageProviderWithOptions::QQuickImageProviderWithOptions(ImageType type, Flags flags)-
214 : QQuickAsyncImageProvider()-
215{-
216 QQuickImageProvider::d->type = type;-
217 QQuickImageProvider::d->flags = flags;-
218 QQuickImageProvider::d->isProviderWithOptions = true;-
219}
executed 16 times by 1 test: end of block
Executed by:
  • tst_sharedimage
16
220-
221QImage QQuickImageProviderWithOptions::requestImage(const QString &id, QSize *size, const QSize& requestedSize)-
222{-
223 return
never executed: return requestImage(id, size, requestedSize, QQuickImageProviderOptions());
requestImage(id, size, requestedSize, QQuickImageProviderOptions());
never executed: return requestImage(id, size, requestedSize, QQuickImageProviderOptions());
0
224}-
225-
226QPixmap QQuickImageProviderWithOptions::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)-
227{-
228 return
never executed: return requestPixmap(id, size, requestedSize, QQuickImageProviderOptions());
requestPixmap(id, size, requestedSize, QQuickImageProviderOptions());
never executed: return requestPixmap(id, size, requestedSize, QQuickImageProviderOptions());
0
229}-
230-
231QQuickTextureFactory *QQuickImageProviderWithOptions::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)-
232{-
233 return
never executed: return requestTexture(id, size, requestedSize, QQuickImageProviderOptions());
requestTexture(id, size, requestedSize, QQuickImageProviderOptions());
never executed: return requestTexture(id, size, requestedSize, QQuickImageProviderOptions());
0
234}-
235-
236QImage QQuickImageProviderWithOptions::requestImage(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options)-
237{-
238 (void)options;;-
239 return
never executed: return QQuickAsyncImageProvider::requestImage(id, size, requestedSize);
QQuickAsyncImageProvider::requestImage(id, size, requestedSize);
never executed: return QQuickAsyncImageProvider::requestImage(id, size, requestedSize);
0
240}-
241-
242QPixmap QQuickImageProviderWithOptions::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options)-
243{-
244 (void)options;;-
245 return
never executed: return QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize);
QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize);
never executed: return QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize);
0
246}-
247-
248QQuickTextureFactory *QQuickImageProviderWithOptions::requestTexture(const QString &id, QSize *size, const QSize &requestedSize, const QQuickImageProviderOptions &options)-
249{-
250 (void)options;;-
251 return
never executed: return QQuickAsyncImageProvider::requestTexture(id, size, requestedSize);
QQuickAsyncImageProvider::requestTexture(id, size, requestedSize);
never executed: return QQuickAsyncImageProvider::requestTexture(id, size, requestedSize);
0
252}-
253-
254QQuickImageResponse *QQuickImageProviderWithOptions::requestImageResponse(const QString &id, const QSize &requestedSize)-
255{-
256 (void)id;;-
257 (void)requestedSize;;-
258 if (imageType() == ImageResponse
imageType() == ImageResponseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
259 QMessageLogger(__FILE__, 653, __PRETTY_FUNCTION__).warning("ImageProvider is of ImageResponse type but has not implemented requestImageResponse()");
never executed: QMessageLogger(__FILE__, 653, __PRETTY_FUNCTION__).warning("ImageProvider is of ImageResponse type but has not implemented requestImageResponse()");
0
260 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
261}-
262-
263QQuickImageResponse *QQuickImageProviderWithOptions::requestImageResponse(const QString &id, const QSize &requestedSize, const QQuickImageProviderOptions &options)-
264{-
265 (void)options;;-
266 return
never executed: return requestImageResponse(id, requestedSize);
requestImageResponse(id, requestedSize);
never executed: return requestImageResponse(id, requestedSize);
0
267}-
268QSize QQuickImageProviderWithOptions::loadSize(const QSize &originalSize, const QSize &requestedSize, const QByteArray &format, const QQuickImageProviderOptions &options)-
269{-
270 QSize res;-
271 if ((requestedSize.width() <= 0
requestedSize.width() <= 0Description
TRUEevaluated 726 times by 35 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
FALSEevaluated 36 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
&& requestedSize.height() <= 0
requestedSize.height() <= 0Description
TRUEevaluated 720 times by 35 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickimage
  • tst_qquickshadereffect
) || originalSize.isEmpty()
originalSize.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 42 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
)
0-726
272 return
executed 720 times by 35 tests: return res;
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
res;
executed 720 times by 35 tests: return res;
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
720
273-
274 const bool preserveAspectCropOrFit = options.preserveAspectRatioCrop()
options.preser...ectRatioCrop()Description
TRUEnever evaluated
FALSEevaluated 42 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
|| options.preserveAspectRatioFit()
options.preser...pectRatioFit()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEevaluated 38 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
;
0-42
275 const bool formatIsSvg = (format == "svg"
format == "svg"Description
TRUEnever evaluated
FALSEevaluated 42 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
|| format == "svgz"
format == "svgz"Description
TRUEnever evaluated
FALSEevaluated 42 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
);
0-42
276-
277 if (!preserveAspectCropOrFit
!preserveAspectCropOrFitDescription
TRUEevaluated 38 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
&& formatIsSvg
formatIsSvgDescription
TRUEnever evaluated
FALSEevaluated 38 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
&& !requestedSize.isEmpty()
!requestedSize.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-38
278 return
never executed: return requestedSize;
requestedSize;
never executed: return requestedSize;
0
279-
280 qreal ratio = 0.0;-
281 if (requestedSize.width()
requestedSize.width()Description
TRUEevaluated 36 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickimage
  • tst_qquickshadereffect
&& (preserveAspectCropOrFit
preserveAspectCropOrFitDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
|| formatIsSvg
formatIsSvgDescription
TRUEnever evaluated
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
||
0-36
282 requestedSize.width() < originalSize.width()
requestedSize....alSize.width()Description
TRUEevaluated 30 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimage
)) {
2-30
283 ratio = qreal(requestedSize.width()) / originalSize.width();-
284 }
executed 34 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquicktext
  • tst_sharedimage
34
285 if (requestedSize.height()
requestedSize.height()Description
TRUEevaluated 40 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimage
&& (preserveAspectCropOrFit
preserveAspectCropOrFitDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
|| formatIsSvg
formatIsSvgDescription
TRUEnever evaluated
FALSEevaluated 36 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
||
0-40
286 requestedSize.height() < originalSize.height()
requestedSize....lSize.height()Description
TRUEevaluated 30 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickimage
  • tst_sharedimage
)) {
6-30
287 qreal hr = qreal(requestedSize.height()) / originalSize.height();-
288 if (ratio == 0.0
ratio == 0.0Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickimage
  • tst_qquickshadereffect
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_sharedimage
)
6-28
289 ratio = hr;
executed 6 times by 2 tests: ratio = hr;
Executed by:
  • tst_qquickimage
  • tst_qquickshadereffect
6
290 else if (!preserveAspectCropOrFit
!preserveAspectCropOrFitDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
&& (
(hr < ratio)Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
hr < ratio)
(hr < ratio)Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
)
4-24
291 ratio = hr;
executed 20 times by 2 tests: ratio = hr;
Executed by:
  • tst_examples
  • tst_qquicktext
20
292 else if (preserveAspectCropOrFit
preserveAspectCropOrFitDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
&& (
(hr > ratio)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEnever evaluated
hr > ratio)
(hr > ratio)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEnever evaluated
)
0-4
293 ratio = hr;
executed 4 times by 1 test: ratio = hr;
Executed by:
  • tst_sharedimage
4
294 }
executed 34 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
34
295 if (ratio > 0.0
ratio > 0.0Description
TRUEevaluated 40 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickimage
) {
2-40
296 res.setHeight(qRound(originalSize.height() * ratio));-
297 res.setWidth(qRound(originalSize.width() * ratio));-
298 }
executed 40 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
40
299 return
executed 42 times by 5 tests: return res;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
res;
executed 42 times by 5 tests: return res;
Executed by:
  • tst_examples
  • tst_qquickimage
  • tst_qquickshadereffect
  • tst_qquicktext
  • tst_sharedimage
42
300}-
301-
302QQuickImageProviderWithOptions *QQuickImageProviderWithOptions::checkedCast(QQuickImageProvider *provider)-
303{-
304 if (provider
providerDescription
TRUEevaluated 8116 times by 5 tests
Evaluated by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickimageprovider
&& provider->d
provider->dDescription
TRUEevaluated 8116 times by 5 tests
Evaluated by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
  • tst_sharedimage
FALSEnever evaluated
&& provider->d->isProviderWithOptions
provider->d->i...derWithOptionsDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_sharedimage
FALSEevaluated 8108 times by 4 tests
Evaluated by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
)
0-8116
305 return
executed 8 times by 1 test: return static_cast<QQuickImageProviderWithOptions *>(provider);
Executed by:
  • tst_sharedimage
static_cast<QQuickImageProviderWithOptions *>(provider);
executed 8 times by 1 test: return static_cast<QQuickImageProviderWithOptions *>(provider);
Executed by:
  • tst_sharedimage
8
306-
307 return
executed 8118 times by 4 tests: return nullptr;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
nullptr;
executed 8118 times by 4 tests: return nullptr;
Executed by:
  • tst_qquickanimatedsprite
  • tst_qquickimage
  • tst_qquickimageprovider
  • tst_qquickpixmapcache
8118
308}-
309-
310-
311-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0