OpenCoverage

qqmlvaluetypewrapper.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlvaluetypewrapper.cpp
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 QtQml 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#include "qqmlvaluetypewrapper_p.h"-
41#include <private/qv8engine_p.h>-
42#include <private/qqmlvaluetype_p.h>-
43#include <private/qqmlbinding_p.h>-
44#include <private/qqmlglobal_p.h>-
45#include <private/qqmlbuiltinfunctions_p.h>-
46-
47#include <private/qv4engine_p.h>-
48#include <private/qv4functionobject_p.h>-
49#include <private/qv4variantobject_p.h>-
50#include <private/qv4alloca_p.h>-
51#include <private/qv4stackframe_p.h>-
52#include <private/qv4objectiterator_p.h>-
53#include <private/qv4qobjectwrapper_p.h>-
54#include <QtCore/qloggingcategory.h>-
55-
56QT_BEGIN_NAMESPACE-
57-
58Q_DECLARE_LOGGING_CATEGORY(lcBindingRemoval)-
59-
60DEFINE_OBJECT_VTABLE(QV4::QQmlValueTypeWrapper);-
61-
62namespace QV4 {-
63namespace Heap {-
64-
65struct QQmlValueTypeReference : QQmlValueTypeWrapper-
66{-
67 void init() {-
68 QQmlValueTypeWrapper::init();-
69 object.init();-
70 }
executed 5148 times by 32 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
5148
71 void destroy() {-
72 object.destroy();-
73 QQmlValueTypeWrapper::destroy();-
74 }
executed 5144 times by 31 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
5144
75 QQmlQPointer<QObject> object;-
76 int property;-
77};-
78-
79}-
80-
81struct QQmlValueTypeReference : public QQmlValueTypeWrapper-
82{-
83 V4_OBJECT2(QQmlValueTypeReference, QQmlValueTypeWrapper)
executed 369666 times by 41 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
never executed: end of block
executed 385110 times by 44 tests: return &static_vtbl;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
executed 91094 times by 32 tests: return static_cast<QV4::Heap::QQmlValueTypeReference *>(m());
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
executed 85946 times by 32 tests: return dptr;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
0-385110
84 V4_NEEDS_DESTROY
executed 5144 times by 31 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
5144
85-
86 bool readReferenceValue() const;-
87};-
88-
89}-
90-
91DEFINE_OBJECT_VTABLE(QV4::QQmlValueTypeReference);-
92-
93using namespace QV4;-
94-
95void Heap::QQmlValueTypeWrapper::destroy()-
96{-
97 if (gadgetPtr) {
gadgetPtrDescription
TRUEevaluated 368572 times by 37 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • ...
FALSEevaluated 422 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickstates
  • tst_quicktestmainwithsetup
  • tst_scenegraph
  • tst_testfiltering
422-368572
98 valueType->metaType.destruct(gadgetPtr);-
99 ::operator delete(gadgetPtr);-
100 }
executed 368572 times by 37 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • ...
368572
101 if (_propertyCache)
_propertyCacheDescription
TRUEevaluated 368992 times by 43 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
2-368992
102 _propertyCache->release();
executed 368992 times by 43 tests: _propertyCache->release();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • ...
368992
103 Object::destroy();-
104}
executed 368994 times by 43 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • ...
368994
105-
106void Heap::QQmlValueTypeWrapper::setValue(const QVariant &value) const-
107{-
108 Q_ASSERT(valueType->typeId == value.userType());-
109 if (gadgetPtr)
gadgetPtrDescription
TRUEevaluated 88 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 364080 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • ...
88-364080
110 valueType->metaType.destruct(gadgetPtr);
executed 88 times by 3 tests: valueType->metaType.destruct(gadgetPtr);
Executed by:
  • tst_examples
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
88
111 if (!gadgetPtr)
!gadgetPtrDescription
TRUEevaluated 364080 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • ...
FALSEevaluated 88 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
88-364080
112 gadgetPtr = ::operator new(valueType->metaType.sizeOf());
executed 364080 times by 29 tests: gadgetPtr = ::operator new(valueType->metaType.sizeOf());
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • ...
364080
113 valueType->metaType.construct(gadgetPtr, value.constData());-
114}
executed 364168 times by 29 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • ...
364168
115-
116QVariant Heap::QQmlValueTypeWrapper::toVariant() const-
117{-
118 Q_ASSERT(gadgetPtr);-
119 return QVariant(valueType->typeId, gadgetPtr);
executed 358802 times by 24 tests: return QVariant(valueType->typeId, gadgetPtr);
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_qquickvisualdatamodel
  • tst_scenegraph
  • tst_sharedimage
358802
120}-
121-
122-
123bool QQmlValueTypeReference::readReferenceValue() const-
124{-
125 if (!d()->object)
!d()->objectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 5276 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
2-5276
126 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmlvaluetypes
2
127 // A reference resource may be either a "true" reference (eg, to a QVector3D property)-
128 // or a "variant" reference (eg, to a QVariant property which happens to contain a value-type).-
129 QMetaProperty writebackProperty = d()->object->metaObject()->property(d()->property);-
130 if (writebackProperty.userType() == QMetaType::QVariant) {
writebackPrope...Type::QVariantDescription
TRUEevaluated 320 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 4956 times by 29 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
320-4956
131 // variant-containing-value-type reference-
132 QVariant variantReferenceValue;-
133-
134 void *a[] = { &variantReferenceValue, nullptr };-
135 QMetaObject::metacall(d()->object, QMetaObject::ReadProperty, d()->property, a);-
136-
137 int variantReferenceType = variantReferenceValue.userType();-
138 if (variantReferenceType != typeId()) {
variantReferen...pe != typeId()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 312 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
8-312
139 // This is a stale VariantReference. That is, the variant has been-
140 // overwritten with a different type in the meantime.-
141 // We need to modify this reference to the updated value type, if-
142 // possible, or return false if it is not a value type.-
143 if (QQmlValueTypeFactory::isValueType(variantReferenceType)) {
QQmlValueTypeF...ReferenceType)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEnever evaluated
0-8
144 QQmlPropertyCache *cache = nullptr;-
145 if (const QMetaObject *mo = QQmlValueTypeFactory::metaObjectForMetaType(variantReferenceType))
const QMetaObj...ReferenceType)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
2-6
146 cache = QJSEnginePrivate::get(engine())->cache(mo);
executed 6 times by 1 test: cache = QJSEnginePrivate::get(engine())->cache(mo);
Executed by:
  • tst_qqmlvaluetypes
6
147 if (d()->gadgetPtr) {
d()->gadgetPtrDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
2-6
148 d()->valueType->metaType.destruct(d()->gadgetPtr);-
149 ::operator delete(d()->gadgetPtr);-
150 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlvaluetypes
6
151 d()->gadgetPtr =nullptr;-
152 d()->setPropertyCache(cache);-
153 d()->valueType = QQmlValueTypeFactory::valueType(variantReferenceType);-
154 if (!cache)
!cacheDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
2-6
155 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmlvaluetypes
2
156 } else {
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlvaluetypes
6
157 return false;
never executed: return false;
0
158 }-
159 }-
160 d()->setValue(variantReferenceValue);-
161 } else {
executed 318 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
318
162 if (!d()->gadgetPtr) {
!d()->gadgetPtrDescription
TRUEevaluated 4498 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktextinput
FALSEevaluated 458 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
458-4498
163 d()->gadgetPtr = ::operator new(d()->valueType->metaType.sizeOf());-
164 d()->valueType->metaType.construct(d()->gadgetPtr, nullptr);-
165 }
executed 4498 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • tst_qquickstates
  • tst_qquicktaphandler
  • tst_qquicktextinput
4498
166 // value-type reference-
167 void *args[] = { d()->gadgetPtr, nullptr };-
168 QMetaObject::metacall(d()->object, QMetaObject::ReadProperty, d()->property, args);-
169 }
executed 4956 times by 29 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
4956
170 return true;
executed 5274 times by 29 tests: return true;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpincharea
  • ...
5274
171}-
172-
173void QQmlValueTypeWrapper::initProto(ExecutionEngine *v4)-
174{-
175 if (v4->valueTypeWrapperPrototype()->d_unchecked())
v4->valueTypeW...>d_unchecked()Description
TRUEevaluated 368370 times by 35 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • ...
FALSEevaluated 628 times by 44 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
628-368370
176 return;
executed 368370 times by 35 tests: return;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • ...
368370
177-
178 Scope scope(v4);-
179 ScopedObject o(scope, v4->newObject());-
180 o->defineDefaultProperty(v4->id_toString(), method_toString, 1);-
181 v4->jsObjects[QV4::ExecutionEngine::ValueTypeProto] = o->d();-
182}
executed 628 times by 44 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
628
183-
184ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, QObject *object, int property, const QMetaObject *metaObject, int typeId)-
185{-
186 Scope scope(engine);-
187 initProto(engine);-
188-
189 Scoped<QQmlValueTypeReference> r(scope, engine->memoryManager->allocate<QQmlValueTypeReference>());-
190 r->d()->object = object;-
191 r->d()->property = property;-
192 r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));-
193 r->d()->valueType = QQmlValueTypeFactory::valueType(typeId);-
194 r->d()->gadgetPtr = nullptr;-
195 return r->asReturnedValue();
executed 5148 times by 32 tests: return r->asReturnedValue();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
5148
196}-
197-
198ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, const QVariant &value, const QMetaObject *metaObject, int typeId)-
199{-
200 Scope scope(engine);-
201 initProto(engine);-
202-
203 Scoped<QQmlValueTypeWrapper> r(scope, engine->memoryManager->allocate<QQmlValueTypeWrapper>());-
204 r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));-
205 r->d()->valueType = QQmlValueTypeFactory::valueType(typeId);-
206 r->d()->gadgetPtr = nullptr;-
207 r->d()->setValue(value);-
208 return r->asReturnedValue();
executed 363850 times by 29 tests: return r->asReturnedValue();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • ...
363850
209}-
210-
211QVariant QQmlValueTypeWrapper::toVariant() const-
212{-
213 if (const QQmlValueTypeReference *ref = as<const QQmlValueTypeReference>())
const QQmlValu...peReference>()Description
TRUEevaluated 834 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickpincharea
  • tst_qquickstates
FALSEevaluated 179230 times by 18 tests
Evaluated by:
  • tst_examples
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickvisualdatamodel
  • tst_scenegraph
  • tst_sharedimage
834-179230
214 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEevaluated 834 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickpincharea
  • tst_qquickstates
0-834
215 return QVariant();
never executed: return QVariant();
0
216 return d()->toVariant();
executed 180064 times by 24 tests: return d()->toVariant();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_qquickvisualdatamodel
  • tst_scenegraph
  • tst_sharedimage
180064
217}-
218-
219bool QQmlValueTypeWrapper::toGadget(void *data) const-
220{-
221 if (const QQmlValueTypeReference *ref = as<const QQmlValueTypeReference>())
const QQmlValu...peReference>()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
0-2
222 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEnever evaluated
0
223 return false;
never executed: return false;
0
224 const int typeId = d()->valueType->typeId;-
225 QMetaType::destruct(typeId, data);-
226 QMetaType::construct(typeId, data, d()->gadgetPtr);-
227 return true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qqmlvaluetypes
2
228}-
229-
230bool QQmlValueTypeWrapper::virtualIsEqualTo(Managed *m, Managed *other)-
231{-
232 Q_ASSERT(m && m->as<QQmlValueTypeWrapper>() && other);-
233 QV4::QQmlValueTypeWrapper *lv = static_cast<QQmlValueTypeWrapper *>(m);-
234-
235 if (QV4::VariantObject *rv = other->as<VariantObject>())
QV4::VariantOb...riantObject>()Description
TRUEnever evaluated
FALSEevaluated 178734 times by 10 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
0-178734
236 return lv->isEqual(rv->d()->data());
never executed: return lv->isEqual(rv->d()->data());
0
237-
238 if (QV4::QQmlValueTypeWrapper *v = other->as<QQmlValueTypeWrapper>())
QV4::QQmlValue...TypeWrapper>()Description
TRUEevaluated 178726 times by 9 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
8-178726
239 return lv->isEqual(v->toVariant());
executed 178726 times by 9 tests: return lv->isEqual(v->toVariant());
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
178726
240-
241 return false;
executed 8 times by 2 tests: return false;
Executed by:
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
8
242}-
243-
244PropertyAttributes QQmlValueTypeWrapper::virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p)-
245{-
246 if (id.isString()) {
id.isString()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
FALSEnever evaluated
0-14
247 Scope scope(m);-
248 ScopedString n(scope, id.asStringOrSymbol());-
249 const QQmlValueTypeWrapper *r = static_cast<const QQmlValueTypeWrapper *>(m);-
250 QQmlPropertyData *result = r->d()->propertyCache()->property(n.getPointer(), nullptr, nullptr);-
251 return result ? Attr_Data : Attr_Invalid;
executed 14 times by 2 tests: return result ? Attr_Data : Attr_Invalid;
Executed by:
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
14
252 }-
253-
254 return QV4::Object::virtualGetOwnProperty(m, id, p);
never executed: return QV4::Object::virtualGetOwnProperty(m, id, p);
0
255}-
256-
257void QQmlValueTypeWrapper::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)-
258{-
259 name->setM(nullptr);-
260 *index = UINT_MAX;-
261-
262 QQmlValueTypeWrapper *that = static_cast<QQmlValueTypeWrapper*>(m);-
263-
264 if (QQmlValueTypeReference *ref = that->as<QQmlValueTypeReference>()) {
QQmlValueTypeR...peReference>()Description
TRUEnever evaluated
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
0-14
265 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEnever evaluated
0
266 return;
never executed: return;
0
267 }
never executed: end of block
0
268-
269 if (that->d()->propertyCache()) {
that->d()->propertyCache()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
FALSEnever evaluated
0-14
270 const QMetaObject *mo = that->d()->propertyCache()->createMetaObject();-
271 const int propertyCount = mo->propertyCount();-
272 if (it->arrayIndex < static_cast<uint>(propertyCount)) {
it->arrayIndex...propertyCount)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
4-10
273 Scope scope(that->engine());-
274 ScopedString propName(scope, that->engine()->newString(QString::fromUtf8(mo->property(it->arrayIndex).name())));-
275 name->setM(propName->d());-
276 ++it->arrayIndex;-
277 *attributes = QV4::Attr_Data;-
278 p->value = that->QV4::Object::get(propName);-
279 return;
executed 10 times by 2 tests: return;
Executed by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
10
280 }-
281 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
4
282 QV4::Object::virtualAdvanceIterator(m, it, name, index, p, attributes);-
283}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypes
  • tst_qquickworkerscript
4
284-
285bool QQmlValueTypeWrapper::isEqual(const QVariant& value) const-
286{-
287 if (const QQmlValueTypeReference *ref = as<const QQmlValueTypeReference>())
const QQmlValu...peReference>()Description
TRUEevaluated 444 times by 6 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickloader
FALSEevaluated 178282 times by 5 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
444-178282
288 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEevaluated 444 times by 6 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickloader
0-444
289 return false;
never executed: return false;
0
290 return (value == d()->toVariant());
executed 178726 times by 9 tests: return (value == d()->toVariant());
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
178726
291}-
292-
293int QQmlValueTypeWrapper::typeId() const-
294{-
295 return d()->valueType->typeId;
executed 322 times by 4 tests: return d()->valueType->typeId;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
322
296}-
297-
298bool QQmlValueTypeWrapper::write(QObject *target, int propertyIndex) const-
299{-
300 bool destructGadgetOnExit = false;-
301 Q_ALLOCA_DECLARE(void, gadget);-
302 if (const QQmlValueTypeReference *ref = as<const QQmlValueTypeReference>()) {
const QQmlValu...peReference>()Description
TRUEevaluated 328 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
FALSEevaluated 2142 times by 19 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_scenegraph
328-2142
303 if (!d()->gadgetPtr) {
!d()->gadgetPtrDescription
TRUEevaluated 328 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
FALSEnever evaluated
0-328
304 Q_ALLOCA_ASSIGN(void, gadget, d()->valueType->metaType.sizeOf());-
305 d()->gadgetPtr = gadget;-
306 d()->valueType->metaType.construct(d()->gadgetPtr, nullptr);-
307 destructGadgetOnExit = true;-
308 }
executed 328 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
328
309 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEevaluated 328 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
0-328
310 return false;
never executed: return false;
0
311 }
executed 328 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
328
312-
313 int flags = 0;-
314 int status = -1;-
315 void *a[] = { d()->gadgetPtr, nullptr, &status, &flags };-
316 QMetaObject::metacall(target, QMetaObject::WriteProperty, propertyIndex, a);-
317-
318 if (destructGadgetOnExit) {
destructGadgetOnExitDescription
TRUEevaluated 328 times by 10 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
FALSEevaluated 2142 times by 19 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_scenegraph
328-2142
319 d()->valueType->metaType.destruct(d()->gadgetPtr);-
320 d()->gadgetPtr = nullptr;-
321 }
executed 328 times by 10 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlenginedebugservice
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
328
322 return true;
executed 2470 times by 24 tests: return true;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickstates
  • tst_scenegraph
2470
323}-
324-
325ReturnedValue QQmlValueTypeWrapper::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
326{-
327 const Object *o = thisObject->as<Object>();-
328 if (!o)
!oDescription
TRUEnever evaluated
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
0-22
329 return b->engine()->throwTypeError();
never executed: return b->engine()->throwTypeError();
0
330 const QQmlValueTypeWrapper *w = o->as<QQmlValueTypeWrapper>();-
331 if (!w)
!wDescription
TRUEnever evaluated
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
0-22
332 return b->engine()->throwTypeError();
never executed: return b->engine()->throwTypeError();
0
333-
334 if (const QQmlValueTypeReference *ref = w->as<QQmlValueTypeReference>())
const QQmlValu...peReference>()Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
4-18
335 if (!ref->readReferenceValue())
!ref->readReferenceValue()Description
TRUEnever evaluated
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
0-18
336 RETURN_UNDEFINED();
never executed: return QV4::Encode::undefined();
0
337-
338 QString result;-
339 // Prepare a buffer to pass to QMetaType::convert()-
340 QString convertResult;-
341 convertResult.~QString();-
342 if (QMetaType::convert(w->d()->gadgetPtr, w->d()->valueType->typeId, &convertResult, QMetaType::QString)) {
QMetaType::con...Type::QString)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
2-20
343 result = convertResult;-
344 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlvaluetypes
2
345 result += QString::fromUtf8(QMetaType::typeName(w->d()->valueType->typeId))-
346 + QLatin1Char('(');-
347 const QMetaObject *mo = w->d()->propertyCache()->metaObject();-
348 const int propCount = mo->propertyCount();-
349 for (int i = 0; i < propCount; ++i) {
i < propCountDescription
TRUEevaluated 144 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
20-144
350 if (mo->property(i).isDesignable()) {
mo->property(i).isDesignable()Description
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
16-128
351 QVariant value = mo->property(i).readOnGadget(w->d()->gadgetPtr);-
352 if (i > 0)
i > 0Description
TRUEevaluated 110 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
18-110
353 result += QLatin1String(", ");
executed 110 times by 2 tests: result += QLatin1String(", ");
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
110
354 result += value.toString();-
355 }
executed 128 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
128
356 }
executed 144 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
144
357 result += QLatin1Char(')');-
358 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
20
359 return Encode(b->engine()->newString(result));
executed 22 times by 2 tests: return Encode(b->engine()->newString(result));
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
22
360}-
361-
362ReturnedValue QQmlValueTypeWrapper::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)-
363{-
364 Q_ASSERT(m->as<QQmlValueTypeWrapper>());-
365-
366 if (!id.isString())
!id.isString()Description
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
FALSEevaluated 8280 times by 20 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktextinput
  • tst_qquickworkerscript
40-8280
367 return Object::virtualGet(m, id, receiver, hasProperty);
executed 40 times by 3 tests: return Object::virtualGet(m, id, receiver, hasProperty);
Executed by:
  • tst_examples
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
40
368-
369 const QQmlValueTypeWrapper *r = static_cast<const QQmlValueTypeWrapper *>(m);-
370 QV4::ExecutionEngine *v4 = r->engine();-
371 Scope scope(v4);-
372 ScopedString name(scope, id.asStringOrSymbol());-
373-
374 // Note: readReferenceValue() can change the reference->type.-
375 if (const QQmlValueTypeReference *reference = r->as<QQmlValueTypeReference>()) {
const QQmlValu...peReference>()Description
TRUEevaluated 3582 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickmousearea
  • tst_qquicktaphandler
  • tst_qquicktextinput
FALSEevaluated 4698 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquickworkerscript
3582-4698
376 if (!reference->readReferenceValue())
!reference->re...ferenceValue()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 3580 times by 16 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickmousearea
  • tst_qquicktaphandler
  • tst_qquicktextinput
2-3580
377 return Primitive::undefinedValue().asReturnedValue();
executed 2 times by 1 test: return Primitive::undefinedValue().asReturnedValue();
Executed by:
  • tst_qqmlvaluetypes
2
378 }
executed 3580 times by 16 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickitem2
  • tst_qquickmousearea
  • tst_qquicktaphandler
  • tst_qquicktextinput
3580
379-
380 QQmlPropertyData *result = r->d()->propertyCache()->property(name.getPointer(), nullptr, nullptr);-
381 if (!result)
!resultDescription
TRUEevaluated 74 times by 4 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
FALSEevaluated 8204 times by 20 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktextinput
  • tst_qquickworkerscript
74-8204
382 return Object::virtualGet(m, id, receiver, hasProperty);
executed 74 times by 4 tests: return Object::virtualGet(m, id, receiver, hasProperty);
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
74
383-
384 if (hasProperty)
hasPropertyDescription
TRUEnever evaluated
FALSEevaluated 8204 times by 20 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktextinput
  • tst_qquickworkerscript
0-8204
385 *hasProperty = true;
never executed: *hasProperty = true;
0
386-
387 if (result->isFunction())
result->isFunction()Description
TRUEevaluated 344 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
FALSEevaluated 7860 times by 19 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquicktextinput
  • tst_qquickworkerscript
344-7860
388 // calling a Q_INVOKABLE function of a value type-
389 return QV4::QObjectMethod::create(v4->rootContext(), r, result->coreIndex());
executed 344 times by 5 tests: return QV4::QObjectMethod::create(v4->rootContext(), r, result->coreIndex());
Executed by:
  • tst_examples
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
344
390-
391#define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \-
392 if (result->propType() == metatype) { \-
393 cpptype v; \-
394 void *args[] = { &v, 0 }; \-
395 metaObject->d.static_metacall(reinterpret_cast<QObject*>(gadget), QMetaObject::ReadProperty, index, args); \-
396 return QV4::Encode(constructor(v)); \-
397 }-
398-
399 const QMetaObject *metaObject = r->d()->propertyCache()->metaObject();-
400-
401 int index = result->coreIndex();-
402 QQmlMetaObject::resolveGadgetMethodOrPropertyIndex(QMetaObject::ReadProperty, &metaObject, &index);-
403-
404 void *gadget = r->d()->gadgetPtr;-
405-
406 // These four types are the most common used by the value type wrappers-
407 VALUE_TYPE_LOAD(QMetaType::QReal, qreal, qreal);
executed 5296 times by 13 tests: return QV4::Encode(qreal(v));
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquickworkerscript
result->propTy...etaType::QRealDescription
TRUEevaluated 5296 times by 13 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquicktaphandler
  • tst_qquickworkerscript
FALSEevaluated 2564 times by 12 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickdraghandler
  • tst_qquickmousearea
  • tst_qquicktaphandler
  • tst_qquicktextinput
2564-5296
408 VALUE_TYPE_LOAD(QMetaType::Int || result->isEnum(), int, int);
executed 328 times by 9 tests: return QV4::Encode(int(v));
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickmousearea
  • tst_qquicktextinput
result->propTy...QMetaType::IntDescription
TRUEevaluated 326 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickanimatedimage
  • tst_qquickmousearea
  • tst_qquicktextinput
FALSEevaluated 2238 times by 6 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
result->isEnum()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 2236 times by 6 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
2-2238
409 VALUE_TYPE_LOAD(QMetaType::Int, int, int);
never executed: return QV4::Encode(int(v));
result->propTy...QMetaType::IntDescription
TRUEnever evaluated
FALSEevaluated 2236 times by 6 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
0-2236
410 VALUE_TYPE_LOAD(QMetaType::QString, QString, v4->newString);
executed 18 times by 2 tests: return QV4::Encode(v4->newString(v));
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
result->propTy...aType::QStringDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 2218 times by 6 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
18-2218
411 VALUE_TYPE_LOAD(QMetaType::Bool, bool, bool);
executed 98 times by 3 tests: return QV4::Encode(bool(v));
Executed by:
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
result->propTy...MetaType::BoolDescription
TRUEevaluated 98 times by 3 tests
Evaluated by:
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 2120 times by 5 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
98-2120
412-
413 QVariant v;-
414 void *args[] = { nullptr, nullptr };-
415 if (result->propType() == QMetaType::QVariant) {
result->propTy...Type::QVariantDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 2118 times by 5 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
2-2118
416 args[0] = &v;-
417 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlvaluetypes
2
418 v = QVariant(result->propType(), static_cast<void *>(nullptr));-
419 args[0] = v.data();-
420 }
executed 2118 times by 5 tests: end of block
Executed by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
2118
421 metaObject->d.static_metacall(reinterpret_cast<QObject*>(gadget), QMetaObject::ReadProperty, index, args);-
422 return v4->fromVariant(v);
executed 2120 times by 5 tests: return v4->fromVariant(v);
Executed by:
  • tst_flickableinterop
  • tst_qqmlitemmodels
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquicktaphandler
2120
423#undef VALUE_TYPE_ACCESSOR-
424}-
425-
426bool QQmlValueTypeWrapper::virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)-
427{-
428 if (!id.isString())
!id.isString()Description
TRUEnever evaluated
FALSEevaluated 88 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
0-88
429 return Object::virtualPut(m, id, value, receiver);
never executed: return Object::virtualPut(m, id, value, receiver);
0
430-
431 Q_ASSERT(m->as<QQmlValueTypeWrapper>());-
432 ExecutionEngine *v4 = static_cast<QQmlValueTypeWrapper *>(m)->engine();-
433 Scope scope(v4);-
434 if (scope.hasException())
scope.hasException()Description
TRUEnever evaluated
FALSEevaluated 88 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
0-88
435 return false;
never executed: return false;
0
436-
437 Scoped<QQmlValueTypeWrapper> r(scope, static_cast<QQmlValueTypeWrapper *>(m));-
438 Scoped<QQmlValueTypeReference> reference(scope, m->d());-
439-
440 int writeBackPropertyType = -1;-
441-
442 if (reference) {
referenceDescription
TRUEevaluated 74 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
14-74
443 QMetaProperty writebackProperty = reference->d()->object->metaObject()->property(reference->d()->property);-
444-
445 if (!writebackProperty.isWritable() || !reference->readReferenceValue())
!writebackProp...y.isWritable()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 72 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
!reference->re...ferenceValue()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 70 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
2-72
446 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qqmlvaluetypes
4
447-
448 writeBackPropertyType = writebackProperty.userType();-
449 }
executed 70 times by 6 tests: end of block
Executed by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
70
450-
451 ScopedString name(scope, id.asStringOrSymbol());-
452-
453 const QMetaObject *metaObject = r->d()->propertyCache()->metaObject();-
454 const QQmlPropertyData *pd = r->d()->propertyCache()->property(name.getPointer(), nullptr, nullptr);-
455 if (!pd)
!pdDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 82 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
2-82
456 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmlvaluetypes
2
457-
458 if (reference) {
referenceDescription
TRUEevaluated 68 times by 6 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
14-68
459 QV4::ScopedFunctionObject f(scope, value);-
460 const QQmlQPointer<QObject> &referenceObject = reference->d()->object;-
461 const int referencePropertyIndex = reference->d()->property;-
462-
463 if (f) {
fDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
FALSEevaluated 60 times by 5 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
8-60
464 if (!f->isBinding()) {
!f->isBinding()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlvaluetypes
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
2-6
465 // assigning a JS function to a non-var-property is not allowed.-
466 QString error = QStringLiteral("Cannot assign JavaScript function to value-type property");-
467 ScopedString e(scope, v4->newString(error));-
468 v4->throwError(e);-
469 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qqmlvaluetypes
2
470 }-
471-
472 QQmlContextData *context = v4->callingQmlContext();-
473-
474 QQmlPropertyData cacheData;-
475 cacheData.setWritable(true);-
476 cacheData.setPropType(writeBackPropertyType);-
477 cacheData.setCoreIndex(referencePropertyIndex);-
478-
479 QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, (const Value &)f);-
480-
481 QV4::ScopedFunctionObject f(scope, bindingFunction->bindingFunction());-
482 QV4::ScopedContext ctx(scope, f->scope());-
483 QQmlBinding *newBinding = QQmlBinding::create(&cacheData, f->function(), referenceObject, context, ctx);-
484 newBinding->setSourceLocation(bindingFunction->currentLocation());-
485 if (f->isBoundFunction())
f->isBoundFunction()Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
0-6
486 newBinding->setBoundFunction(static_cast<QV4::BoundFunction *>(f.getPointer()));
never executed: newBinding->setBoundFunction(static_cast<QV4::BoundFunction *>(f.getPointer()));
0
487 newBinding->setSourceLocation(bindingFunction->currentLocation());-
488 newBinding->setTarget(referenceObject, cacheData, pd);-
489 QQmlPropertyPrivate::setBinding(newBinding);-
490 return true;
executed 6 times by 2 tests: return true;
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
6
491 } else {-
492 if (Q_UNLIKELY(lcBindingRemoval().isInfoEnabled())) {
__builtin_expe...led()), false)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlbinding
FALSEevaluated 58 times by 4 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
2-58
493 if (auto binding = QQmlPropertyPrivate::binding(referenceObject, QQmlPropertyIndex(referencePropertyIndex, pd->coreIndex()))) {
auto binding =...>coreIndex()))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlbinding
FALSEnever evaluated
0-2
494 Q_ASSERT(!binding->isValueTypeProxy());-
495 const auto qmlBinding = static_cast<const QQmlBinding*>(binding);-
496 const auto stackFrame = v4->currentStackFrame;-
497 qCInfo(lcBindingRemoval,
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
qt_category_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlbinding
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlbinding
2
498 "Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d",
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
2
499 referenceObject->metaObject()->className(), referenceObject->metaObject()->property(referencePropertyIndex).name(),
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
2
500 qPrintable(qmlBinding->expressionIdentifier()),
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
2
501 metaObject->property(pd->coreIndex()).name(),
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
2
502 qPrintable(stackFrame->source()), stackFrame->lineNumber());
executed 2 times by 1 test: QMessageLogger( __FILE__ , 502 , __PRETTY_FUNCTION__, lcBindingRemoval().categoryName()).info("Overwriting binding on %s::%s which was initially bound at %s by setting \"%s\" at %s:%d", referenceObject->metaObject()->className(), referenceObject->metaObje...ferencePropertyIndex).name(), QtPrivate::asString(qmlBinding->expressionIdentifier()).toLocal8Bit().constData(), metaObject->property(pd->coreIndex()).name(), QtPrivate::asString(stackFrame->source()).toLocal8Bit().constData(), stackFrame->lineNumber()) ;
Executed by:
  • tst_qqmlbinding
2
503 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlbinding
2
504 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlbinding
2
505 QQmlPropertyPrivate::removeBinding(referenceObject, QQmlPropertyIndex(referencePropertyIndex, pd->coreIndex()));-
506 }
executed 60 times by 5 tests: end of block
Executed by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
60
507 }-
508-
509 QMetaProperty property = metaObject->property(pd->coreIndex());-
510 Q_ASSERT(property.isValid());-
511-
512 QVariant v = v4->toVariant(value, property.userType());-
513-
514 if (property.isEnumType() && (QMetaType::Type)v.type() == QMetaType::Double)
property.isEnumType()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
FALSEevaluated 70 times by 5 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
(QMetaType::Ty...taType::DoubleDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
0-70
515 v = v.toInt();
never executed: v = v.toInt();
0
516-
517 void *gadget = r->d()->gadgetPtr;-
518 property.writeOnGadget(gadget, v);-
519-
520-
521 if (reference) {
referenceDescription
TRUEevaluated 60 times by 5 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
14-60
522 if (writeBackPropertyType == QMetaType::QVariant) {
writeBackPrope...Type::QVariantDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
FALSEevaluated 48 times by 5 tests
Evaluated by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
12-48
523 QVariant variantReferenceValue = r->d()->toVariant();-
524-
525 int flags = 0;-
526 int status = -1;-
527 void *a[] = { &variantReferenceValue, nullptr, &status, &flags };-
528 QMetaObject::metacall(reference->d()->object, QMetaObject::WriteProperty, reference->d()->property, a);-
529-
530 } else {
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
12
531 int flags = 0;-
532 int status = -1;-
533 void *a[] = { r->d()->gadgetPtr, nullptr, &status, &flags };-
534 QMetaObject::metacall(reference->d()->object, QMetaObject::WriteProperty, reference->d()->property, a);-
535 }
executed 48 times by 5 tests: end of block
Executed by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
48
536 }-
537-
538 return true;
executed 74 times by 5 tests: return true;
Executed by:
  • tst_qqmlbinding
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickbehaviors
  • tst_qquickdrag
74
539}-
540-
541QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0