OpenCoverage

qqmlvme.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlvme.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 "qqmlvme_p.h"-
41-
42#include "qqmlboundsignal_p.h"-
43#include "qqmlstringconverters_p.h"-
44#include <private/qmetaobjectbuilder_p.h>-
45#include "qqmldata_p.h"-
46#include "qqml.h"-
47#include "qqmlinfo.h"-
48#include "qqmlcustomparser_p.h"-
49#include "qqmlengine.h"-
50#include "qqmlcontext.h"-
51#include "qqmlcomponent.h"-
52#include "qqmlcomponentattached_p.h"-
53#include "qqmlbinding_p.h"-
54#include "qqmlengine_p.h"-
55#include "qqmlcomponent_p.h"-
56#include "qqmlvmemetaobject_p.h"-
57#include "qqmlcontext_p.h"-
58#include "qqmlglobal_p.h"-
59#include <private/qfinitestack_p.h>-
60#include "qqmlscriptstring.h"-
61#include "qqmlscriptstring_p.h"-
62#include "qqmlpropertyvalueinterceptor_p.h"-
63#include "qqmlvaluetypeproxybinding_p.h"-
64#include "qqmlexpression_p.h"-
65-
66#include <QStack>-
67#include <QPointF>-
68#include <QSizeF>-
69#include <QRectF>-
70#include <QtCore/qdebug.h>-
71#include <QtCore/qvarlengtharray.h>-
72#include <QtCore/qcoreapplication.h>-
73#include <QtCore/qdatetime.h>-
74#include <QtCore/qvarlengtharray.h>-
75#include <QtQml/qjsvalue.h>-
76-
77QT_BEGIN_NAMESPACE-
78-
79using namespace QQmlVMETypes;-
80-
81bool QQmlVME::s_enableComponentComplete = true;-
82-
83void QQmlVME::enableComponentComplete()-
84{-
85 s_enableComponentComplete = true;-
86}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
4
87-
88void QQmlVME::disableComponentComplete()-
89{-
90 s_enableComponentComplete = false;-
91}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
4
92-
93bool QQmlVME::componentCompleteEnabled()-
94{-
95 return s_enableComponentComplete;
executed 157780 times by 139 tests: return s_enableComponentComplete;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • ...
157780
96}-
97-
98QQmlVMEGuard::QQmlVMEGuard()-
99: m_objectCount(0), m_objects(nullptr), m_contextCount(0), m_contexts(nullptr)-
100{-
101}
executed 88821 times by 32 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
88821
102-
103QQmlVMEGuard::~QQmlVMEGuard()-
104{-
105 clear();-
106}
executed 88672 times by 32 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
88672
107-
108void QQmlVMEGuard::guard(QQmlObjectCreator *creator)-
109{-
110 clear();-
111-
112 QFiniteStack<QPointer<QObject> > &objects = creator->allCreatedObjects();-
113 m_objectCount = objects.count();-
114 m_objects = new QPointer<QObject>[m_objectCount];-
115 for (int ii = 0; ii < m_objectCount; ++ii)
ii < m_objectCountDescription
TRUEevaluated 5709 times by 8 tests
Evaluated by:
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 4577 times by 11 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
4577-5709
116 m_objects[ii] = objects[ii];
executed 5709 times by 8 tests: m_objects[ii] = objects[ii];
Executed by:
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickrepeater
5709
117-
118 m_contextCount = 1;-
119 m_contexts = new QQmlGuardedContextData[m_contextCount];-
120 m_contexts[0] = creator->parentContextData();-
121}
executed 4577 times by 11 tests: end of block
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
4577
122-
123void QQmlVMEGuard::clear()-
124{-
125 delete [] m_objects;-
126 delete [] m_contexts;-
127-
128 m_objectCount = 0;-
129 m_objects = nullptr;-
130 m_contextCount = 0;-
131 m_contexts = nullptr;-
132}
executed 449624 times by 32 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
449624
133-
134bool QQmlVMEGuard::isOK() const-
135{-
136 for (int ii = 0; ii < m_objectCount; ++ii)
ii < m_objectCountDescription
TRUEevaluated 5719 times by 8 tests
Evaluated by:
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 356400 times by 32 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
5719-356400
137 if (m_objects[ii].isNull())
m_objects[ii].isNull()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qqmlincubator
FALSEevaluated 5709 times by 8 tests
Evaluated by:
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpathview
  • tst_qquickrepeater
10-5709
138 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qqmlincubator
10
139-
140 for (int ii = 0; ii < m_contextCount; ++ii)
ii < m_contextCountDescription
TRUEevaluated 4595 times by 11 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
FALSEevaluated 356326 times by 32 tests
Evaluated by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
4595-356326
141 if (m_contexts[ii].isNull() || !m_contexts[ii]->engine)
m_contexts[ii].isNull()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlincubator
FALSEevaluated 4591 times by 11 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
!m_contexts[ii]->engineDescription
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_qquickgridview
  • tst_qquicklistview
FALSEevaluated 4521 times by 11 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmltypeloader
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
4-4591
142 return false;
executed 74 times by 3 tests: return false;
Executed by:
  • tst_qqmlincubator
  • tst_qquickgridview
  • tst_qquicklistview
74
143-
144 return true;
executed 356326 times by 32 tests: return true;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickmousearea
  • ...
356326
145}-
146-
147QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0