kernel/qmetaobjectbuilder.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtCore 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 Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qmetaobjectbuilder_p.h" -
43 -
44#include "qobject_p.h" -
45#include "qmetaobject_p.h" -
46 -
47#include <stdlib.h> -
48 -
49QT_BEGIN_NAMESPACE -
50 -
51/*! -
52 \class QMetaObjectBuilder -
53 \inmodule QtCore -
54 \internal -
55 \brief The QMetaObjectBuilder class supports building QMetaObject objects at runtime. -
56 -
57*/ -
58 -
59/*! -
60 \enum QMetaObjectBuilder::AddMember -
61 This enum defines which members of QMetaObject should be copied by QMetaObjectBuilder::addMetaObject() -
62 -
63 \value ClassName Add the class name. -
64 \value SuperClass Add the super class. -
65 \value Methods Add methods that aren't signals or slots. -
66 \value Signals Add signals. -
67 \value Slots Add slots. -
68 \value Constructors Add constructors. -
69 \value Properties Add properties. -
70 \value Enumerators Add enumerators. -
71 \value ClassInfos Add items of class information. -
72 \value RelatedMetaObjects Add related meta objects. -
73 \value StaticMetacall Add the static metacall function. -
74 \value PublicMethods Add public methods (ignored for signals). -
75 \value ProtectedMethods Add protected methods (ignored for signals). -
76 \value PrivateMethods All private methods (ignored for signals). -
77 \value AllMembers Add all members. -
78 \value AllPrimaryMembers Add everything except the class name, super class, and static metacall function. -
79*/ -
80 -
81// copied from moc's generator.cpp -
82namespace QtPrivate { -
83Q_CORE_EXPORT bool isBuiltinType(const QByteArray &type) -
84{ -
85 int id = QMetaType::type(type);
executed (the execution status of this line is deduced): int id = QMetaType::type(type);
-
86 if (!id && !type.isEmpty() && type != "void")
evaluated: !id
TRUEFALSE
yes
Evaluation Count:82
yes
Evaluation Count:444
evaluated: !type.isEmpty()
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:46
partially evaluated: type != "void"
TRUEFALSE
yes
Evaluation Count:36
no
Evaluation Count:0
0-444
87 return false;
executed: return false;
Execution Count:36
36
88 return (id < QMetaType::User);
executed: return (id < QMetaType::User);
Execution Count:490
490
89} -
90} // namespace QtPrivate -
91 -
92// copied from qmetaobject.cpp -
93static inline const QMetaObjectPrivate *priv(const uint* data) -
94{ return reinterpret_cast<const QMetaObjectPrivate*>(data); }
never executed: return reinterpret_cast<const QMetaObjectPrivate*>(data);
0
95 -
96class QMetaMethodBuilderPrivate -
97{ -
98public: -
99 QMetaMethodBuilderPrivate -
100 (QMetaMethod::MethodType _methodType, -
101 const QByteArray& _signature, -
102 const QByteArray& _returnType = QByteArray("void"), -
103 QMetaMethod::Access _access = QMetaMethod::Public, -
104 int _revision = 0) -
105 : signature(QMetaObject::normalizedSignature(_signature.constData())), -
106 returnType(QMetaObject::normalizedType(_returnType)), -
107 attributes(((int)_access) | (((int)_methodType) << 2)), -
108 revision(_revision) -
109 { -
110 Q_ASSERT((_methodType == QMetaMethod::Constructor) == returnType.isNull());
executed (the execution status of this line is deduced): qt_noop();
-
111 }
executed: }
Execution Count:128
128
112 -
113 QByteArray signature; -
114 QByteArray returnType; -
115 QList<QByteArray> parameterNames; -
116 QByteArray tag; -
117 int attributes; -
118 int revision; -
119 -
120 QMetaMethod::MethodType methodType() const -
121 { -
122 return (QMetaMethod::MethodType)((attributes & MethodTypeMask) >> 2);
executed: return (QMetaMethod::MethodType)((attributes & MethodTypeMask) >> 2);
Execution Count:190
190
123 } -
124 -
125 QMetaMethod::Access access() const -
126 { -
127 return (QMetaMethod::Access)(attributes & AccessMask);
executed: return (QMetaMethod::Access)(attributes & AccessMask);
Execution Count:19
19
128 } -
129 -
130 void setAccess(QMetaMethod::Access value) -
131 { -
132 attributes = ((attributes & ~AccessMask) | (int)value);
executed (the execution status of this line is deduced): attributes = ((attributes & ~AccessMask) | (int)value);
-
133 }
executed: }
Execution Count:51
51
134 -
135 QList<QByteArray> parameterTypes() const -
136 { -
137 return QMetaObjectPrivate::parameterTypeNamesFromSignature(signature);
executed: return QMetaObjectPrivate::parameterTypeNamesFromSignature(signature);
Execution Count:721
721
138 } -
139 -
140 int parameterCount() const -
141 { -
142 return parameterTypes().size();
executed: return parameterTypes().size();
Execution Count:468
468
143 } -
144 -
145 QByteArray name() const -
146 { -
147 return signature.left(qMax(signature.indexOf('('), 0));
executed: return signature.left(qMax(signature.indexOf('('), 0));
Execution Count:234
234
148 } -
149}; -
150 -
151class QMetaPropertyBuilderPrivate -
152{ -
153public: -
154 QMetaPropertyBuilderPrivate -
155 (const QByteArray& _name, const QByteArray& _type, int notifierIdx=-1, -
156 int _revision = 0) -
157 : name(_name), -
158 type(QMetaObject::normalizedType(_type.constData())), -
159 flags(Readable | Writable | Scriptable), notifySignal(-1), -
160 revision(_revision) -
161 { -
162 if (notifierIdx >= 0) {
partially evaluated: notifierIdx >= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:37
0-37
163 flags |= Notify;
never executed (the execution status of this line is deduced): flags |= Notify;
-
164 notifySignal = notifierIdx;
never executed (the execution status of this line is deduced): notifySignal = notifierIdx;
-
165 }
never executed: }
0
166 }
executed: }
Execution Count:37
37
167 -
168 QByteArray name; -
169 QByteArray type; -
170 int flags; -
171 int notifySignal; -
172 int revision; -
173 -
174 bool flag(int f) const -
175 { -
176 return ((flags & f) != 0);
executed: return ((flags & f) != 0);
Execution Count:368
368
177 } -
178 -
179 void setFlag(int f, bool value) -
180 { -
181 if (value)
evaluated: value
TRUEFALSE
yes
Evaluation Count:115
yes
Evaluation Count:256
115-256
182 flags |= f;
executed: flags |= f;
Execution Count:115
115
183 else -
184 flags &= ~f;
executed: flags &= ~f;
Execution Count:256
256
185 } -
186}; -
187 -
188class QMetaEnumBuilderPrivate -
189{ -
190public: -
191 QMetaEnumBuilderPrivate(const QByteArray& _name) -
192 : name(_name), isFlag(false) -
193 { -
194 }
executed: }
Execution Count:8
8
195 -
196 QByteArray name; -
197 bool isFlag; -
198 QList<QByteArray> keys; -
199 QList<int> values; -
200}; -
201 -
202class QMetaObjectBuilderPrivate -
203{ -
204public: -
205 QMetaObjectBuilderPrivate() -
206 : flags(0) -
207 { -
208 superClass = &QObject::staticMetaObject;
executed (the execution status of this line is deduced): superClass = &QObject::staticMetaObject;
-
209 staticMetacallFunction = 0;
executed (the execution status of this line is deduced): staticMetacallFunction = 0;
-
210 }
executed: }
Execution Count:34
34
211 -
212 bool hasRevisionedProperties() const; -
213 bool hasRevisionedMethods() const; -
214 -
215 QByteArray className; -
216 const QMetaObject *superClass; -
217 QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction; -
218 QList<QMetaMethodBuilderPrivate> methods; -
219 QList<QMetaMethodBuilderPrivate> constructors; -
220 QList<QMetaPropertyBuilderPrivate> properties; -
221 QList<QByteArray> classInfoNames; -
222 QList<QByteArray> classInfoValues; -
223 QList<QMetaEnumBuilderPrivate> enumerators; -
224 QList<const QMetaObject *> relatedMetaObjects; -
225 int flags; -
226}; -
227 -
228bool QMetaObjectBuilderPrivate::hasRevisionedProperties() const -
229{ -
230 for (int i = 0; i < properties.size(); ++i) {
evaluated: i < properties.size()
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:28
28-44
231 if (properties.at(i).revision)
evaluated: properties.at(i).revision
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:38
6-38
232 return true;
executed: return true;
Execution Count:6
6
233 }
executed: }
Execution Count:38
38
234 return false;
executed: return false;
Execution Count:28
28
235} -
236 -
237bool QMetaObjectBuilderPrivate::hasRevisionedMethods() const -
238{ -
239 for (int i = 0; i < methods.size(); ++i) {
evaluated: i < methods.size()
TRUEFALSE
yes
Evaluation Count:164
yes
Evaluation Count:28
28-164
240 if (methods.at(i).revision)
evaluated: methods.at(i).revision
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:158
6-158
241 return true;
executed: return true;
Execution Count:6
6
242 }
executed: }
Execution Count:158
158
243 return false;
executed: return false;
Execution Count:28
28
244} -
245 -
246/*! -
247 Constructs a new QMetaObjectBuilder. -
248*/ -
249QMetaObjectBuilder::QMetaObjectBuilder() -
250{ -
251 d = new QMetaObjectBuilderPrivate();
executed (the execution status of this line is deduced): d = new QMetaObjectBuilderPrivate();
-
252}
executed: }
Execution Count:30
30
253 -
254/*! -
255 Constructs a new QMetaObjectBuilder which is a copy of the -
256 meta object information in \a prototype. Note: the super class -
257 contents for \a prototype are not copied, only the immediate -
258 class that is defined by \a prototype. -
259 -
260 The \a members parameter indicates which members of \a prototype -
261 should be added. The default is AllMembers. -
262 -
263 \sa addMetaObject() -
264*/ -
265QMetaObjectBuilder::QMetaObjectBuilder -
266 (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members) -
267{ -
268 d = new QMetaObjectBuilderPrivate();
executed (the execution status of this line is deduced): d = new QMetaObjectBuilderPrivate();
-
269 addMetaObject(prototype, members);
executed (the execution status of this line is deduced): addMetaObject(prototype, members);
-
270}
executed: }
Execution Count:4
4
271 -
272/*! -
273 Destroys this meta object builder. -
274*/ -
275QMetaObjectBuilder::~QMetaObjectBuilder() -
276{ -
277 delete d;
executed (the execution status of this line is deduced): delete d;
-
278}
executed: }
Execution Count:34
34
279 -
280/*! -
281 Returns the name of the class being constructed by this -
282 meta object builder. The default value is an empty QByteArray. -
283 -
284 \sa setClassName(), superClass() -
285*/ -
286QByteArray QMetaObjectBuilder::className() const -
287{ -
288 return d->className; -
289} -
290 -
291/*! -
292 Sets the \a name of the class being constructed by this -
293 meta object builder. -
294 -
295 \sa className(), setSuperClass() -
296*/ -
297void QMetaObjectBuilder::setClassName(const QByteArray& name) -
298{ -
299 d->className = name;
executed (the execution status of this line is deduced): d->className = name;
-
300}
executed: }
Execution Count:13
13
301 -
302/*! -
303 Returns the superclass meta object of the class being constructed -
304 by this meta object builder. The default value is the meta object -
305 for QObject. -
306 -
307 \sa setSuperClass(), className() -
308*/ -
309const QMetaObject *QMetaObjectBuilder::superClass() const -
310{ -
311 return d->superClass;
executed: return d->superClass;
Execution Count:18
18
312} -
313 -
314/*! -
315 Sets the superclass meta object of the class being constructed -
316 by this meta object builder to \a meta. The \a meta parameter -
317 must not be null. -
318 -
319 \sa superClass(), setClassName() -
320*/ -
321void QMetaObjectBuilder::setSuperClass(const QMetaObject *meta) -
322{ -
323 Q_ASSERT(meta);
executed (the execution status of this line is deduced): qt_noop();
-
324 d->superClass = meta;
executed (the execution status of this line is deduced): d->superClass = meta;
-
325}
executed: }
Execution Count:2
2
326 -
327/*! -
328 Returns the flags of the class being constructed by this meta object -
329 builder. -
330 -
331 \sa setFlags() -
332*/ -
333QMetaObjectBuilder::MetaObjectFlags QMetaObjectBuilder::flags() const -
334{ -
335 return (QMetaObjectBuilder::MetaObjectFlags)d->flags;
executed: return (QMetaObjectBuilder::MetaObjectFlags)d->flags;
Execution Count:2
2
336} -
337 -
338/*! -
339 Sets the \a flags of the class being constructed by this meta object -
340 builder. -
341 -
342 \sa flags() -
343*/ -
344void QMetaObjectBuilder::setFlags(MetaObjectFlags flags) -
345{ -
346 d->flags = flags;
executed (the execution status of this line is deduced): d->flags = flags;
-
347}
executed: }
Execution Count:1
1
348 -
349/*! -
350 Returns the number of methods in this class, excluding the number -
351 of methods in the base class. These include signals and slots -
352 as well as normal member functions. -
353 -
354 \sa addMethod(), method(), removeMethod(), indexOfMethod() -
355*/ -
356int QMetaObjectBuilder::methodCount() const -
357{ -
358 return d->methods.size();
executed: return d->methods.size();
Execution Count:20
20
359} -
360 -
361/*! -
362 Returns the number of constructors in this class. -
363 -
364 \sa addConstructor(), constructor(), removeConstructor(), indexOfConstructor() -
365*/ -
366int QMetaObjectBuilder::constructorCount() const -
367{ -
368 return d->constructors.size();
executed: return d->constructors.size();
Execution Count:18
18
369} -
370 -
371/*! -
372 Returns the number of properties in this class, excluding the number -
373 of properties in the base class. -
374 -
375 \sa addProperty(), property(), removeProperty(), indexOfProperty() -
376*/ -
377int QMetaObjectBuilder::propertyCount() const -
378{ -
379 return d->properties.size();
executed: return d->properties.size();
Execution Count:17
17
380} -
381 -
382/*! -
383 Returns the number of enumerators in this class, excluding the -
384 number of enumerators in the base class. -
385 -
386 \sa addEnumerator(), enumerator(), removeEnumerator() -
387 \sa indexOfEnumerator() -
388*/ -
389int QMetaObjectBuilder::enumeratorCount() const -
390{ -
391 return d->enumerators.size();
executed: return d->enumerators.size();
Execution Count:15
15
392} -
393 -
394/*! -
395 Returns the number of items of class information in this class, -
396 exclusing the number of items of class information in the base class. -
397 -
398 \sa addClassInfo(), classInfoName(), classInfoValue(), removeClassInfo() -
399 \sa indexOfClassInfo() -
400*/ -
401int QMetaObjectBuilder::classInfoCount() const -
402{ -
403 return d->classInfoNames.size();
executed: return d->classInfoNames.size();
Execution Count:14
14
404} -
405 -
406/*! -
407 Returns the number of related meta objects that are associated -
408 with this class. -
409 -
410 Related meta objects are used when resolving the enumerated type -
411 associated with a property, where the enumerated type is in a -
412 different class from the property. -
413 -
414 \sa addRelatedMetaObject(), relatedMetaObject() -
415 \sa removeRelatedMetaObject() -
416*/ -
417int QMetaObjectBuilder::relatedMetaObjectCount() const -
418{ -
419 return d->relatedMetaObjects.size();
executed: return d->relatedMetaObjects.size();
Execution Count:14
14
420} -
421 -
422/*! -
423 Adds a new public method to this class with the specified \a signature. -
424 Returns an object that can be used to adjust the other attributes -
425 of the method. The \a signature will be normalized before it is -
426 added to the class. -
427 -
428 \sa method(), methodCount(), removeMethod(), indexOfMethod() -
429*/ -
430QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QByteArray& signature) -
431{ -
432 int index = d->methods.size();
executed (the execution status of this line is deduced): int index = d->methods.size();
-
433 d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Method, signature));
executed (the execution status of this line is deduced): d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Method, signature));
-
434 return QMetaMethodBuilder(this, index);
executed: return QMetaMethodBuilder(this, index);
Execution Count:23
23
435} -
436 -
437/*! -
438 Adds a new public method to this class with the specified -
439 \a signature and \a returnType. Returns an object that can be -
440 used to adjust the other attributes of the method. The \a signature -
441 and \a returnType will be normalized before they are added to -
442 the class. -
443 -
444 \sa method(), methodCount(), removeMethod(), indexOfMethod() -
445*/ -
446QMetaMethodBuilder QMetaObjectBuilder::addMethod -
447 (const QByteArray& signature, const QByteArray& returnType) -
448{ -
449 int index = d->methods.size();
executed (the execution status of this line is deduced): int index = d->methods.size();
-
450 d->methods.append(QMetaMethodBuilderPrivate
executed (the execution status of this line is deduced): d->methods.append(QMetaMethodBuilderPrivate
-
451 (QMetaMethod::Method, signature, returnType));
executed (the execution status of this line is deduced): (QMetaMethod::Method, signature, returnType));
-
452 return QMetaMethodBuilder(this, index);
executed: return QMetaMethodBuilder(this, index);
Execution Count:1
1
453} -
454 -
455/*! -
456 Adds a new public method to this class that has the same information as -
457 \a prototype. This is used to clone the methods of an existing -
458 QMetaObject. Returns an object that can be used to adjust the -
459 attributes of the method. -
460 -
461 This function will detect if \a prototype is an ordinary method, -
462 signal, slot, or constructor and act accordingly. -
463 -
464 \sa method(), methodCount(), removeMethod(), indexOfMethod() -
465*/ -
466QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QMetaMethod& prototype) -
467{ -
468 QMetaMethodBuilder method;
executed (the execution status of this line is deduced): QMetaMethodBuilder method;
-
469 if (prototype.methodType() == QMetaMethod::Method)
evaluated: prototype.methodType() == QMetaMethod::Method
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:51
2-51
470 method = addMethod(prototype.methodSignature());
executed: method = addMethod(prototype.methodSignature());
Execution Count:2
2
471 else if (prototype.methodType() == QMetaMethod::Signal)
evaluated: prototype.methodType() == QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:41
10-41
472 method = addSignal(prototype.methodSignature());
executed: method = addSignal(prototype.methodSignature());
Execution Count:10
10
473 else if (prototype.methodType() == QMetaMethod::Slot)
evaluated: prototype.methodType() == QMetaMethod::Slot
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:1
1-40
474 method = addSlot(prototype.methodSignature());
executed: method = addSlot(prototype.methodSignature());
Execution Count:40
40
475 else if (prototype.methodType() == QMetaMethod::Constructor)
partially evaluated: prototype.methodType() == QMetaMethod::Constructor
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
476 method = addConstructor(prototype.methodSignature());
executed: method = addConstructor(prototype.methodSignature());
Execution Count:1
1
477 method.setReturnType(prototype.typeName());
executed (the execution status of this line is deduced): method.setReturnType(prototype.typeName());
-
478 method.setParameterNames(prototype.parameterNames());
executed (the execution status of this line is deduced): method.setParameterNames(prototype.parameterNames());
-
479 method.setTag(prototype.tag());
executed (the execution status of this line is deduced): method.setTag(prototype.tag());
-
480 method.setAccess(prototype.access());
executed (the execution status of this line is deduced): method.setAccess(prototype.access());
-
481 method.setAttributes(prototype.attributes());
executed (the execution status of this line is deduced): method.setAttributes(prototype.attributes());
-
482 method.setRevision(prototype.revision());
executed (the execution status of this line is deduced): method.setRevision(prototype.revision());
-
483 return method;
executed: return method;
Execution Count:53
53
484} -
485 -
486/*! -
487 Adds a new public slot to this class with the specified \a signature. -
488 Returns an object that can be used to adjust the other attributes -
489 of the slot. The \a signature will be normalized before it is -
490 added to the class. -
491 -
492 \sa addMethod(), addSignal(), indexOfSlot() -
493*/ -
494QMetaMethodBuilder QMetaObjectBuilder::addSlot(const QByteArray& signature) -
495{ -
496 int index = d->methods.size();
executed (the execution status of this line is deduced): int index = d->methods.size();
-
497 d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Slot, signature));
executed (the execution status of this line is deduced): d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Slot, signature));
-
498 return QMetaMethodBuilder(this, index);
executed: return QMetaMethodBuilder(this, index);
Execution Count:53
53
499} -
500 -
501/*! -
502 Adds a new signal to this class with the specified \a signature. -
503 Returns an object that can be used to adjust the other attributes -
504 of the signal. The \a signature will be normalized before it is -
505 added to the class. -
506 -
507 \sa addMethod(), addSlot(), indexOfSignal() -
508*/ -
509QMetaMethodBuilder QMetaObjectBuilder::addSignal(const QByteArray& signature) -
510{ -
511 int index = d->methods.size();
executed (the execution status of this line is deduced): int index = d->methods.size();
-
512 d->methods.append(QMetaMethodBuilderPrivate
executed (the execution status of this line is deduced): d->methods.append(QMetaMethodBuilderPrivate
-
513 (QMetaMethod::Signal, signature, QByteArray("void"), QMetaMethod::Protected));
executed (the execution status of this line is deduced): (QMetaMethod::Signal, signature, QByteArray("void"), QMetaMethod::Protected));
-
514 return QMetaMethodBuilder(this, index);
executed: return QMetaMethodBuilder(this, index);
Execution Count:25
25
515} -
516 -
517/*! -
518 Adds a new constructor to this class with the specified \a signature. -
519 Returns an object that can be used to adjust the other attributes -
520 of the constructor. The \a signature will be normalized before it is -
521 added to the class. -
522 -
523 \sa constructor(), constructorCount(), removeConstructor() -
524 \sa indexOfConstructor() -
525*/ -
526QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QByteArray& signature) -
527{ -
528 int index = d->constructors.size();
executed (the execution status of this line is deduced): int index = d->constructors.size();
-
529 d->constructors.append(QMetaMethodBuilderPrivate(QMetaMethod::Constructor, signature,
executed (the execution status of this line is deduced): d->constructors.append(QMetaMethodBuilderPrivate(QMetaMethod::Constructor, signature,
-
530 /*returnType=*/QByteArray()));
executed (the execution status of this line is deduced): QByteArray()));
-
531 return QMetaMethodBuilder(this, -(index + 1));
executed: return QMetaMethodBuilder(this, -(index + 1));
Execution Count:26
26
532} -
533 -
534/*! -
535 Adds a new constructor to this class that has the same information as -
536 \a prototype. This is used to clone the constructors of an existing -
537 QMetaObject. Returns an object that can be used to adjust the -
538 attributes of the constructor. -
539 -
540 This function requires that \a prototype be a constructor. -
541 -
542 \sa constructor(), constructorCount(), removeConstructor() -
543 \sa indexOfConstructor() -
544*/ -
545QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QMetaMethod& prototype) -
546{ -
547 Q_ASSERT(prototype.methodType() == QMetaMethod::Constructor);
executed (the execution status of this line is deduced): qt_noop();
-
548 QMetaMethodBuilder ctor = addConstructor(prototype.methodSignature());
executed (the execution status of this line is deduced): QMetaMethodBuilder ctor = addConstructor(prototype.methodSignature());
-
549 ctor.setReturnType(prototype.typeName());
executed (the execution status of this line is deduced): ctor.setReturnType(prototype.typeName());
-
550 ctor.setParameterNames(prototype.parameterNames());
executed (the execution status of this line is deduced): ctor.setParameterNames(prototype.parameterNames());
-
551 ctor.setTag(prototype.tag());
executed (the execution status of this line is deduced): ctor.setTag(prototype.tag());
-
552 ctor.setAccess(prototype.access());
executed (the execution status of this line is deduced): ctor.setAccess(prototype.access());
-
553 ctor.setAttributes(prototype.attributes());
executed (the execution status of this line is deduced): ctor.setAttributes(prototype.attributes());
-
554 return ctor;
executed: return ctor;
Execution Count:4
4
555} -
556 -
557/*! -
558 Adds a new readable/writable property to this class with the -
559 specified \a name and \a type. Returns an object that can be used -
560 to adjust the other attributes of the property. The \a type will -
561 be normalized before it is added to the class. \a notifierId will -
562 be registered as the property's \e notify signal. -
563 -
564 \sa property(), propertyCount(), removeProperty(), indexOfProperty() -
565*/ -
566QMetaPropertyBuilder QMetaObjectBuilder::addProperty -
567 (const QByteArray& name, const QByteArray& type, int notifierId) -
568{ -
569 int index = d->properties.size();
executed (the execution status of this line is deduced): int index = d->properties.size();
-
570 d->properties.append(QMetaPropertyBuilderPrivate(name, type, notifierId));
executed (the execution status of this line is deduced): d->properties.append(QMetaPropertyBuilderPrivate(name, type, notifierId));
-
571 return QMetaPropertyBuilder(this, index);
executed: return QMetaPropertyBuilder(this, index);
Execution Count:37
37
572} -
573 -
574/*! -
575 Adds a new property to this class that has the same information as -
576 \a prototype. This is used to clone the properties of an existing -
577 QMetaObject. Returns an object that can be used to adjust the -
578 attributes of the property. -
579 -
580 \sa property(), propertyCount(), removeProperty(), indexOfProperty() -
581*/ -
582QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& prototype) -
583{ -
584 QMetaPropertyBuilder property = addProperty(prototype.name(), prototype.typeName());
executed (the execution status of this line is deduced): QMetaPropertyBuilder property = addProperty(prototype.name(), prototype.typeName());
-
585 property.setReadable(prototype.isReadable());
executed (the execution status of this line is deduced): property.setReadable(prototype.isReadable());
-
586 property.setWritable(prototype.isWritable());
executed (the execution status of this line is deduced): property.setWritable(prototype.isWritable());
-
587 property.setResettable(prototype.isResettable());
executed (the execution status of this line is deduced): property.setResettable(prototype.isResettable());
-
588 property.setDesignable(prototype.isDesignable());
executed (the execution status of this line is deduced): property.setDesignable(prototype.isDesignable());
-
589 property.setScriptable(prototype.isScriptable());
executed (the execution status of this line is deduced): property.setScriptable(prototype.isScriptable());
-
590 property.setStored(prototype.isStored());
executed (the execution status of this line is deduced): property.setStored(prototype.isStored());
-
591 property.setEditable(prototype.isEditable());
executed (the execution status of this line is deduced): property.setEditable(prototype.isEditable());
-
592 property.setUser(prototype.isUser());
executed (the execution status of this line is deduced): property.setUser(prototype.isUser());
-
593 property.setStdCppSet(prototype.hasStdCppSet());
executed (the execution status of this line is deduced): property.setStdCppSet(prototype.hasStdCppSet());
-
594 property.setEnumOrFlag(prototype.isEnumType());
executed (the execution status of this line is deduced): property.setEnumOrFlag(prototype.isEnumType());
-
595 property.setConstant(prototype.isConstant());
executed (the execution status of this line is deduced): property.setConstant(prototype.isConstant());
-
596 property.setFinal(prototype.isFinal());
executed (the execution status of this line is deduced): property.setFinal(prototype.isFinal());
-
597 property.setRevision(prototype.revision());
executed (the execution status of this line is deduced): property.setRevision(prototype.revision());
-
598 if (prototype.hasNotifySignal()) {
evaluated: prototype.hasNotifySignal()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:10
4-10
599 // Find an existing method for the notify signal, or add a new one. -
600 QMetaMethod method = prototype.notifySignal();
executed (the execution status of this line is deduced): QMetaMethod method = prototype.notifySignal();
-
601 int index = indexOfMethod(method.methodSignature());
executed (the execution status of this line is deduced): int index = indexOfMethod(method.methodSignature());
-
602 if (index == -1)
evaluated: index == -1
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
603 index = addMethod(method).index();
executed: index = addMethod(method).index();
Execution Count:1
1
604 d->properties[property._index].notifySignal = index;
executed (the execution status of this line is deduced): d->properties[property._index].notifySignal = index;
-
605 d->properties[property._index].setFlag(Notify, true);
executed (the execution status of this line is deduced): d->properties[property._index].setFlag(Notify, true);
-
606 }
executed: }
Execution Count:4
4
607 return property;
executed: return property;
Execution Count:14
14
608} -
609 -
610/*! -
611 Adds a new enumerator to this class with the specified -
612 \a name. Returns an object that can be used to adjust -
613 the other attributes of the enumerator. -
614 -
615 \sa enumerator(), enumeratorCount(), removeEnumerator() -
616 \sa indexOfEnumerator() -
617*/ -
618QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QByteArray& name) -
619{ -
620 int index = d->enumerators.size();
executed (the execution status of this line is deduced): int index = d->enumerators.size();
-
621 d->enumerators.append(QMetaEnumBuilderPrivate(name));
executed (the execution status of this line is deduced): d->enumerators.append(QMetaEnumBuilderPrivate(name));
-
622 return QMetaEnumBuilder(this, index);
executed: return QMetaEnumBuilder(this, index);
Execution Count:8
8
623} -
624 -
625/*! -
626 Adds a new enumerator to this class that has the same information as -
627 \a prototype. This is used to clone the enumerators of an existing -
628 QMetaObject. Returns an object that can be used to adjust the -
629 attributes of the enumerator. -
630 -
631 \sa enumerator(), enumeratorCount(), removeEnumerator() -
632 \sa indexOfEnumerator() -
633*/ -
634QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QMetaEnum& prototype) -
635{ -
636 QMetaEnumBuilder en = addEnumerator(prototype.name());
executed (the execution status of this line is deduced): QMetaEnumBuilder en = addEnumerator(prototype.name());
-
637 en.setIsFlag(prototype.isFlag());
executed (the execution status of this line is deduced): en.setIsFlag(prototype.isFlag());
-
638 int count = prototype.keyCount();
executed (the execution status of this line is deduced): int count = prototype.keyCount();
-
639 for (int index = 0; index < count; ++index)
evaluated: index < count
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:4
4-8
640 en.addKey(prototype.key(index), prototype.value(index));
executed: en.addKey(prototype.key(index), prototype.value(index));
Execution Count:8
8
641 return en;
executed: return en;
Execution Count:4
4
642} -
643 -
644/*! -
645 Adds \a name and \a value as an item of class information to this class. -
646 Returns the index of the new item of class information. -
647 -
648 \sa classInfoCount(), classInfoName(), classInfoValue(), removeClassInfo() -
649 \sa indexOfClassInfo() -
650*/ -
651int QMetaObjectBuilder::addClassInfo(const QByteArray& name, const QByteArray& value) -
652{ -
653 int index = d->classInfoNames.size();
executed (the execution status of this line is deduced): int index = d->classInfoNames.size();
-
654 d->classInfoNames += name;
executed (the execution status of this line is deduced): d->classInfoNames += name;
-
655 d->classInfoValues += value;
executed (the execution status of this line is deduced): d->classInfoValues += value;
-
656 return index;
executed: return index;
Execution Count:8
8
657} -
658 -
659/*! -
660 Adds \a meta to this class as a related meta object. Returns -
661 the index of the new related meta object entry. -
662 -
663 Related meta objects are used when resolving the enumerated type -
664 associated with a property, where the enumerated type is in a -
665 different class from the property. -
666 -
667 \sa relatedMetaObjectCount(), relatedMetaObject() -
668 \sa removeRelatedMetaObject() -
669*/ -
670int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObject *meta) -
671{ -
672 Q_ASSERT(meta);
executed (the execution status of this line is deduced): qt_noop();
-
673 int index = d->relatedMetaObjects.size();
executed (the execution status of this line is deduced): int index = d->relatedMetaObjects.size();
-
674 d->relatedMetaObjects.append(meta);
executed (the execution status of this line is deduced): d->relatedMetaObjects.append(meta);
-
675 return index;
executed: return index;
Execution Count:5
5
676} -
677 -
678/*! -
679 Adds the contents of \a prototype to this meta object builder. -
680 This function is useful for cloning the contents of an existing QMetaObject. -
681 -
682 The \a members parameter indicates which members of \a prototype -
683 should be added. The default is AllMembers. -
684*/ -
685void QMetaObjectBuilder::addMetaObject -
686 (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members) -
687{ -
688 Q_ASSERT(prototype);
executed (the execution status of this line is deduced): qt_noop();
-
689 int index;
executed (the execution status of this line is deduced): int index;
-
690 -
691 if ((members & ClassName) != 0)
evaluated: (members & ClassName) != 0
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:2
2-5
692 d->className = prototype->className();
executed: d->className = prototype->className();
Execution Count:5
5
693 -
694 if ((members & SuperClass) != 0)
evaluated: (members & SuperClass) != 0
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
1-6
695 d->superClass = prototype->superClass();
executed: d->superClass = prototype->superClass();
Execution Count:6
6
696 -
697 if ((members & (Methods | Signals | Slots)) != 0) {
evaluated: (members & (Methods | Signals | Slots)) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
698 for (index = prototype->methodOffset(); index < prototype->methodCount(); ++index) {
evaluated: index < prototype->methodCount()
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:4
4-51
699 QMetaMethod method = prototype->method(index);
executed (the execution status of this line is deduced): QMetaMethod method = prototype->method(index);
-
700 if (method.methodType() != QMetaMethod::Signal) {
evaluated: method.methodType() != QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:9
9-42
701 if (method.access() == QMetaMethod::Public && (members & PublicMethods) == 0)
evaluated: method.access() == QMetaMethod::Public
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:33
partially evaluated: (members & PublicMethods) == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-33
702 continue;
never executed: continue;
0
703 if (method.access() == QMetaMethod::Private && (members & PrivateMethods) == 0)
evaluated: method.access() == QMetaMethod::Private
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:13
partially evaluated: (members & PrivateMethods) == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:29
0-29
704 continue;
never executed: continue;
0
705 if (method.access() == QMetaMethod::Protected && (members & ProtectedMethods) == 0)
evaluated: method.access() == QMetaMethod::Protected
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:38
partially evaluated: (members & ProtectedMethods) == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-38
706 continue;
never executed: continue;
0
707 }
executed: }
Execution Count:42
42
708 if (method.methodType() == QMetaMethod::Method && (members & Methods) != 0) {
evaluated: method.methodType() == QMetaMethod::Method
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:49
partially evaluated: (members & Methods) != 0
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-49
709 addMethod(method);
executed (the execution status of this line is deduced): addMethod(method);
-
710 } else if (method.methodType() == QMetaMethod::Signal &&
executed: }
Execution Count:2
evaluated: method.methodType() == QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:40
2-40
711 (members & Signals) != 0) {
partially evaluated: (members & Signals) != 0
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
712 addMethod(method);
executed (the execution status of this line is deduced): addMethod(method);
-
713 } else if (method.methodType() == QMetaMethod::Slot &&
executed: }
Execution Count:9
partially evaluated: method.methodType() == QMetaMethod::Slot
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
714 (members & Slots) != 0) {
partially evaluated: (members & Slots) != 0
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
715 addMethod(method);
executed (the execution status of this line is deduced): addMethod(method);
-
716 }
executed: }
Execution Count:40
40
717 } -
718 }
executed: }
Execution Count:4
4
719 -
720 if ((members & Constructors) != 0) {
evaluated: (members & Constructors) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
721 for (index = 0; index < prototype->constructorCount(); ++index)
evaluated: index < prototype->constructorCount()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
722 addConstructor(prototype->constructor(index));
executed: addConstructor(prototype->constructor(index));
Execution Count:4
4
723 }
executed: }
Execution Count:4
4
724 -
725 if ((members & Properties) != 0) {
evaluated: (members & Properties) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
726 for (index = prototype->propertyOffset(); index < prototype->propertyCount(); ++index)
evaluated: index < prototype->propertyCount()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:4
4-13
727 addProperty(prototype->property(index));
executed: addProperty(prototype->property(index));
Execution Count:13
13
728 }
executed: }
Execution Count:4
4
729 -
730 if ((members & Enumerators) != 0) {
evaluated: (members & Enumerators) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
731 for (index = prototype->enumeratorOffset(); index < prototype->enumeratorCount(); ++index)
evaluated: index < prototype->enumeratorCount()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
732 addEnumerator(prototype->enumerator(index));
executed: addEnumerator(prototype->enumerator(index));
Execution Count:4
4
733 }
executed: }
Execution Count:4
4
734 -
735 if ((members & ClassInfos) != 0) {
evaluated: (members & ClassInfos) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
736 for (index = prototype->classInfoOffset(); index < prototype->classInfoCount(); ++index) {
evaluated: index < prototype->classInfoCount()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
737 QMetaClassInfo ci = prototype->classInfo(index);
executed (the execution status of this line is deduced): QMetaClassInfo ci = prototype->classInfo(index);
-
738 addClassInfo(ci.name(), ci.value());
executed (the execution status of this line is deduced): addClassInfo(ci.name(), ci.value());
-
739 }
executed: }
Execution Count:4
4
740 }
executed: }
Execution Count:4
4
741 -
742 if ((members & RelatedMetaObjects) != 0) {
evaluated: (members & RelatedMetaObjects) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
743 Q_ASSERT(priv(prototype->d.data)->revision >= 2);
executed (the execution status of this line is deduced): qt_noop();
-
744 const QMetaObject **objects = prototype->d.relatedMetaObjects;
executed (the execution status of this line is deduced): const QMetaObject **objects = prototype->d.relatedMetaObjects;
-
745 if (objects) {
evaluated: objects
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
746 while (*objects != 0) {
evaluated: *objects != 0
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
747 addRelatedMetaObject(*objects);
executed (the execution status of this line is deduced): addRelatedMetaObject(*objects);
-
748 ++objects;
executed (the execution status of this line is deduced): ++objects;
-
749 }
executed: }
Execution Count:2
2
750 }
executed: }
Execution Count:2
2
751 }
executed: }
Execution Count:4
4
752 -
753 if ((members & StaticMetacall) != 0) {
evaluated: (members & StaticMetacall) != 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
3-4
754 Q_ASSERT(priv(prototype->d.data)->revision >= 6);
executed (the execution status of this line is deduced): qt_noop();
-
755 if (prototype->d.static_metacall)
partially evaluated: prototype->d.static_metacall
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
756 setStaticMetacallFunction(prototype->d.static_metacall);
executed: setStaticMetacallFunction(prototype->d.static_metacall);
Execution Count:4
4
757 }
executed: }
Execution Count:4
4
758}
executed: }
Execution Count:7
7
759 -
760/*! -
761 Returns the method at \a index in this class. -
762 -
763 \sa methodCount(), addMethod(), removeMethod(), indexOfMethod() -
764*/ -
765QMetaMethodBuilder QMetaObjectBuilder::method(int index) const -
766{ -
767 if (index >= 0 && index < d->methods.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
0-4
768 return QMetaMethodBuilder(this, index);
executed: return QMetaMethodBuilder(this, index);
Execution Count:3
3
769 else -
770 return QMetaMethodBuilder();
executed: return QMetaMethodBuilder();
Execution Count:1
1
771} -
772 -
773/*! -
774 Returns the constructor at \a index in this class. -
775 -
776 \sa methodCount(), addMethod(), removeMethod(), indexOfConstructor() -
777*/ -
778QMetaMethodBuilder QMetaObjectBuilder::constructor(int index) const -
779{ -
780 if (index >= 0 && index < d->constructors.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
evaluated: index < d->constructors.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
0-3
781 return QMetaMethodBuilder(this, -(index + 1));
executed: return QMetaMethodBuilder(this, -(index + 1));
Execution Count:2
2
782 else -
783 return QMetaMethodBuilder();
executed: return QMetaMethodBuilder();
Execution Count:1
1
784} -
785 -
786/*! -
787 Returns the property at \a index in this class. -
788 -
789 \sa methodCount(), addMethod(), removeMethod(), indexOfProperty() -
790*/ -
791QMetaPropertyBuilder QMetaObjectBuilder::property(int index) const -
792{ -
793 if (index >= 0 && index < d->properties.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
0-7
794 return QMetaPropertyBuilder(this, index);
executed: return QMetaPropertyBuilder(this, index);
Execution Count:6
6
795 else -
796 return QMetaPropertyBuilder();
executed: return QMetaPropertyBuilder();
Execution Count:1
1
797} -
798 -
799/*! -
800 Returns the enumerator at \a index in this class. -
801 -
802 \sa enumeratorCount(), addEnumerator(), removeEnumerator() -
803 \sa indexOfEnumerator() -
804*/ -
805QMetaEnumBuilder QMetaObjectBuilder::enumerator(int index) const -
806{ -
807 if (index >= 0 && index < d->enumerators.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
0-3
808 return QMetaEnumBuilder(this, index);
executed: return QMetaEnumBuilder(this, index);
Execution Count:2
2
809 else -
810 return QMetaEnumBuilder();
executed: return QMetaEnumBuilder();
Execution Count:1
1
811} -
812 -
813/*! -
814 Returns the related meta object at \a index in this class. -
815 -
816 Related meta objects are used when resolving the enumerated type -
817 associated with a property, where the enumerated type is in a -
818 different class from the property. -
819 -
820 \sa relatedMetaObjectCount(), addRelatedMetaObject() -
821 \sa removeRelatedMetaObject() -
822*/ -
823const QMetaObject *QMetaObjectBuilder::relatedMetaObject(int index) const -
824{ -
825 if (index >= 0 && index < d->relatedMetaObjects.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: index < d->relatedMetaObjects.size()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
826 return d->relatedMetaObjects[index];
executed: return d->relatedMetaObjects[index];
Execution Count:3
3
827 else -
828 return 0;
never executed: return 0;
0
829} -
830 -
831/*! -
832 Returns the name of the item of class information at \a index -
833 in this class. -
834 -
835 \sa classInfoCount(), addClassInfo(), classInfoValue(), removeClassInfo() -
836 \sa indexOfClassInfo() -
837*/ -
838QByteArray QMetaObjectBuilder::classInfoName(int index) const -
839{ -
840 if (index >= 0 && index < d->classInfoNames.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
evaluated: index < d->classInfoNames.size()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
0-4
841 return d->classInfoNames[index];
executed: return d->classInfoNames[index];
Execution Count:3
3
842 else -
843 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
844} -
845 -
846/*! -
847 Returns the value of the item of class information at \a index -
848 in this class. -
849 -
850 \sa classInfoCount(), addClassInfo(), classInfoName(), removeClassInfo() -
851 \sa indexOfClassInfo() -
852*/ -
853QByteArray QMetaObjectBuilder::classInfoValue(int index) const -
854{ -
855 if (index >= 0 && index < d->classInfoValues.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
evaluated: index < d->classInfoValues.size()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
0-4
856 return d->classInfoValues[index];
executed: return d->classInfoValues[index];
Execution Count:3
3
857 else -
858 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
859} -
860 -
861/*! -
862 Removes the method at \a index from this class. The indices of -
863 all following methods will be adjusted downwards by 1. If the -
864 method is registered as a notify signal on a property, then the -
865 notify signal will be removed from the property. -
866 -
867 \sa methodCount(), addMethod(), method(), indexOfMethod() -
868*/ -
869void QMetaObjectBuilder::removeMethod(int index) -
870{ -
871 if (index >= 0 && index < d->methods.size()) {
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
872 d->methods.removeAt(index);
executed (the execution status of this line is deduced): d->methods.removeAt(index);
-
873 for (int prop = 0; prop < d->properties.size(); ++prop) {
evaluated: prop < d->properties.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
874 // Adjust the indices of property notify signal references. -
875 if (d->properties[prop].notifySignal == index) {
evaluated: d->properties[prop].notifySignal == index
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
876 d->properties[prop].notifySignal = -1;
executed (the execution status of this line is deduced): d->properties[prop].notifySignal = -1;
-
877 d->properties[prop].setFlag(Notify, false);
executed (the execution status of this line is deduced): d->properties[prop].setFlag(Notify, false);
-
878 } else if (d->properties[prop].notifySignal > index)
executed: }
Execution Count:1
partially evaluated: d->properties[prop].notifySignal > index
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
879 (d->properties[prop].notifySignal)--;
executed: (d->properties[prop].notifySignal)--;
Execution Count:1
1
880 } -
881 }
executed: }
Execution Count:3
3
882}
executed: }
Execution Count:3
3
883 -
884/*! -
885 Removes the constructor at \a index from this class. The indices of -
886 all following constructors will be adjusted downwards by 1. -
887 -
888 \sa constructorCount(), addConstructor(), constructor() -
889 \sa indexOfConstructor() -
890*/ -
891void QMetaObjectBuilder::removeConstructor(int index) -
892{ -
893 if (index >= 0 && index < d->constructors.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->constructors.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
894 d->constructors.removeAt(index);
executed: d->constructors.removeAt(index);
Execution Count:1
1
895}
executed: }
Execution Count:1
1
896 -
897/*! -
898 Removes the property at \a index from this class. The indices of -
899 all following properties will be adjusted downwards by 1. -
900 -
901 \sa propertyCount(), addProperty(), property(), indexOfProperty() -
902*/ -
903void QMetaObjectBuilder::removeProperty(int index) -
904{ -
905 if (index >= 0 && index < d->properties.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
906 d->properties.removeAt(index);
executed: d->properties.removeAt(index);
Execution Count:1
1
907}
executed: }
Execution Count:1
1
908 -
909/*! -
910 Removes the enumerator at \a index from this class. The indices of -
911 all following enumerators will be adjusted downwards by 1. -
912 -
913 \sa enumertorCount(), addEnumerator(), enumerator() -
914 \sa indexOfEnumerator() -
915*/ -
916void QMetaObjectBuilder::removeEnumerator(int index) -
917{ -
918 if (index >= 0 && index < d->enumerators.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
919 d->enumerators.removeAt(index);
executed: d->enumerators.removeAt(index);
Execution Count:1
1
920}
executed: }
Execution Count:1
1
921 -
922/*! -
923 Removes the item of class information at \a index from this class. -
924 The indices of all following items will be adjusted downwards by 1. -
925 -
926 \sa classInfoCount(), addClassInfo(), classInfoName(), classInfoValue() -
927 \sa indexOfClassInfo() -
928*/ -
929void QMetaObjectBuilder::removeClassInfo(int index) -
930{ -
931 if (index >= 0 && index < d->classInfoNames.size()) {
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->classInfoNames.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
932 d->classInfoNames.removeAt(index);
executed (the execution status of this line is deduced): d->classInfoNames.removeAt(index);
-
933 d->classInfoValues.removeAt(index);
executed (the execution status of this line is deduced): d->classInfoValues.removeAt(index);
-
934 }
executed: }
Execution Count:1
1
935}
executed: }
Execution Count:1
1
936 -
937/*! -
938 Removes the related meta object at \a index from this class. -
939 The indices of all following related meta objects will be adjusted -
940 downwards by 1. -
941 -
942 Related meta objects are used when resolving the enumerated type -
943 associated with a property, where the enumerated type is in a -
944 different class from the property. -
945 -
946 \sa relatedMetaObjectCount(), addRelatedMetaObject() -
947 \sa relatedMetaObject() -
948*/ -
949void QMetaObjectBuilder::removeRelatedMetaObject(int index) -
950{ -
951 if (index >= 0 && index < d->relatedMetaObjects.size())
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->relatedMetaObjects.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
952 d->relatedMetaObjects.removeAt(index);
executed: d->relatedMetaObjects.removeAt(index);
Execution Count:1
1
953}
executed: }
Execution Count:1
1
954 -
955/*! -
956 Finds a method with the specified \a signature and returns its index; -
957 otherwise returns -1. The \a signature will be normalized by this method. -
958 -
959 \sa method(), methodCount(), addMethod(), removeMethod() -
960*/ -
961int QMetaObjectBuilder::indexOfMethod(const QByteArray& signature) -
962{ -
963 QByteArray sig = QMetaObject::normalizedSignature(signature);
executed (the execution status of this line is deduced): QByteArray sig = QMetaObject::normalizedSignature(signature);
-
964 for (int index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:4
4-17
965 if (sig == d->methods[index].signature)
evaluated: sig == d->methods[index].signature
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:11
6-11
966 return index;
executed: return index;
Execution Count:6
6
967 }
executed: }
Execution Count:11
11
968 return -1;
executed: return -1;
Execution Count:4
4
969} -
970 -
971/*! -
972 Finds a signal with the specified \a signature and returns its index; -
973 otherwise returns -1. The \a signature will be normalized by this method. -
974 -
975 \sa indexOfMethod(), indexOfSlot() -
976*/ -
977int QMetaObjectBuilder::indexOfSignal(const QByteArray& signature) -
978{ -
979 QByteArray sig = QMetaObject::normalizedSignature(signature);
executed (the execution status of this line is deduced): QByteArray sig = QMetaObject::normalizedSignature(signature);
-
980 for (int index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:1
1-5
981 if (sig == d->methods[index].signature &&
evaluated: sig == d->methods[index].signature
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
982 d->methods[index].methodType() == QMetaMethod::Signal)
partially evaluated: d->methods[index].methodType() == QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
983 return index;
executed: return index;
Execution Count:2
2
984 }
executed: }
Execution Count:3
3
985 return -1;
executed: return -1;
Execution Count:1
1
986} -
987 -
988/*! -
989 Finds a slot with the specified \a signature and returns its index; -
990 otherwise returns -1. The \a signature will be normalized by this method. -
991 -
992 \sa indexOfMethod(), indexOfSignal() -
993*/ -
994int QMetaObjectBuilder::indexOfSlot(const QByteArray& signature) -
995{ -
996 QByteArray sig = QMetaObject::normalizedSignature(signature);
executed (the execution status of this line is deduced): QByteArray sig = QMetaObject::normalizedSignature(signature);
-
997 for (int index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:1
1-5
998 if (sig == d->methods[index].signature &&
evaluated: sig == d->methods[index].signature
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
999 d->methods[index].methodType() == QMetaMethod::Slot)
partially evaluated: d->methods[index].methodType() == QMetaMethod::Slot
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1000 return index;
executed: return index;
Execution Count:2
2
1001 }
executed: }
Execution Count:3
3
1002 return -1;
executed: return -1;
Execution Count:1
1
1003} -
1004 -
1005/*! -
1006 Finds a constructor with the specified \a signature and returns its index; -
1007 otherwise returns -1. The \a signature will be normalized by this method. -
1008 -
1009 \sa constructor(), constructorCount(), addConstructor(), removeConstructor() -
1010*/ -
1011int QMetaObjectBuilder::indexOfConstructor(const QByteArray& signature) -
1012{ -
1013 QByteArray sig = QMetaObject::normalizedSignature(signature);
executed (the execution status of this line is deduced): QByteArray sig = QMetaObject::normalizedSignature(signature);
-
1014 for (int index = 0; index < d->constructors.size(); ++index) {
evaluated: index < d->constructors.size()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:3
3-8
1015 if (sig == d->constructors[index].signature)
evaluated: sig == d->constructors[index].signature
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
3-5
1016 return index;
executed: return index;
Execution Count:3
3
1017 }
executed: }
Execution Count:5
5
1018 return -1;
executed: return -1;
Execution Count:3
3
1019} -
1020 -
1021/*! -
1022 Finds a property with the specified \a name and returns its index; -
1023 otherwise returns -1. -
1024 -
1025 \sa property(), propertyCount(), addProperty(), removeProperty() -
1026*/ -
1027int QMetaObjectBuilder::indexOfProperty(const QByteArray& name) -
1028{ -
1029 for (int index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:3
3-8
1030 if (name == d->properties[index].name)
evaluated: name == d->properties[index].name
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
3-5
1031 return index;
executed: return index;
Execution Count:3
3
1032 }
executed: }
Execution Count:5
5
1033 return -1;
executed: return -1;
Execution Count:3
3
1034} -
1035 -
1036/*! -
1037 Finds an enumerator with the specified \a name and returns its index; -
1038 otherwise returns -1. -
1039 -
1040 \sa enumertor(), enumeratorCount(), addEnumerator(), removeEnumerator() -
1041*/ -
1042int QMetaObjectBuilder::indexOfEnumerator(const QByteArray& name) -
1043{ -
1044 for (int index = 0; index < d->enumerators.size(); ++index) {
evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:3
3-8
1045 if (name == d->enumerators[index].name)
evaluated: name == d->enumerators[index].name
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
3-5
1046 return index;
executed: return index;
Execution Count:3
3
1047 }
executed: }
Execution Count:5
5
1048 return -1;
executed: return -1;
Execution Count:3
3
1049} -
1050 -
1051/*! -
1052 Finds an item of class information with the specified \a name and -
1053 returns its index; otherwise returns -1. -
1054 -
1055 \sa classInfoName(), classInfoValue(), classInfoCount(), addClassInfo() -
1056 \sa removeClassInfo() -
1057*/ -
1058int QMetaObjectBuilder::indexOfClassInfo(const QByteArray& name) -
1059{ -
1060 for (int index = 0; index < d->classInfoNames.size(); ++index) {
evaluated: index < d->classInfoNames.size()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:3
3-8
1061 if (name == d->classInfoNames[index])
evaluated: name == d->classInfoNames[index]
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
3-5
1062 return index;
executed: return index;
Execution Count:3
3
1063 }
executed: }
Execution Count:5
5
1064 return -1;
executed: return -1;
Execution Count:3
3
1065} -
1066 -
1067// Align on a specific type boundary. -
1068#define ALIGN(size,type) \ -
1069 (size) = ((size) + sizeof(type) - 1) & ~(sizeof(type) - 1) -
1070 -
1071/*! -
1072 \class QMetaStringTable -
1073 \inmodule QtCore -
1074 \internal -
1075 \brief The QMetaStringTable class can generate a meta-object string table at runtime. -
1076*/ -
1077 -
1078QMetaStringTable::QMetaStringTable() -
1079 : m_index(0) {}
executed: }
Execution Count:168
168
1080 -
1081// Enters the given value into the string table (if it hasn't already been -
1082// entered). Returns the index of the string. -
1083int QMetaStringTable::enter(const QByteArray &value) -
1084{ -
1085 Entries::iterator it = m_entries.find(value);
executed (the execution status of this line is deduced): Entries::iterator it = m_entries.find(value);
-
1086 if (it != m_entries.end())
evaluated: it != m_entries.end()
TRUEFALSE
yes
Evaluation Count:1440
yes
Evaluation Count:2231
1440-2231
1087 return it.value();
executed: return it.value();
Execution Count:1440
1440
1088 int pos = m_index;
executed (the execution status of this line is deduced): int pos = m_index;
-
1089 m_entries.insert(value, pos);
executed (the execution status of this line is deduced): m_entries.insert(value, pos);
-
1090 ++m_index;
executed (the execution status of this line is deduced): ++m_index;
-
1091 return pos;
executed: return pos;
Execution Count:2231
2231
1092} -
1093 -
1094int QMetaStringTable::preferredAlignment() -
1095{ -
1096 return Q_ALIGNOF(QByteArrayData);
never executed: return __alignof__(QByteArrayData);
0
1097} -
1098 -
1099// Returns the size (in bytes) required for serializing this string table. -
1100int QMetaStringTable::blobSize() const -
1101{ -
1102 int size = m_entries.size() * sizeof(QByteArrayData);
executed (the execution status of this line is deduced): int size = m_entries.size() * sizeof(QByteArrayData);
-
1103 Entries::const_iterator it;
executed (the execution status of this line is deduced): Entries::const_iterator it;
-
1104 for (it = m_entries.constBegin(); it != m_entries.constEnd(); ++it)
evaluated: it != m_entries.constEnd()
TRUEFALSE
yes
Evaluation Count:2231
yes
Evaluation Count:168
168-2231
1105 size += it.key().size() + 1;
executed: size += it.key().size() + 1;
Execution Count:2231
2231
1106 return size;
executed: return size;
Execution Count:168
168
1107} -
1108 -
1109// Writes strings to string data struct. -
1110// The struct consists of an array of QByteArrayData, followed by a char array -
1111// containing the actual strings. This format must match the one produced by -
1112// moc (see generator.cpp). -
1113void QMetaStringTable::writeBlob(char *out) -
1114{ -
1115 Q_ASSERT(!(reinterpret_cast<quintptr>(out) & (preferredAlignment()-1)));
executed (the execution status of this line is deduced): qt_noop();
-
1116 -
1117 int offsetOfStringdataMember = m_entries.size() * sizeof(QByteArrayData);
executed (the execution status of this line is deduced): int offsetOfStringdataMember = m_entries.size() * sizeof(QByteArrayData);
-
1118 int stringdataOffset = 0;
executed (the execution status of this line is deduced): int stringdataOffset = 0;
-
1119 for (int i = 0; i < m_entries.size(); ++i) {
evaluated: i < m_entries.size()
TRUEFALSE
yes
Evaluation Count:1984
yes
Evaluation Count:151
151-1984
1120 const QByteArray &str = m_entries.key(i);
executed (the execution status of this line is deduced): const QByteArray &str = m_entries.key(i);
-
1121 int size = str.size();
executed (the execution status of this line is deduced): int size = str.size();
-
1122 qptrdiff offset = offsetOfStringdataMember + stringdataOffset
executed (the execution status of this line is deduced): qptrdiff offset = offsetOfStringdataMember + stringdataOffset
-
1123 - i * sizeof(QByteArrayData);
executed (the execution status of this line is deduced): - i * sizeof(QByteArrayData);
-
1124 const QByteArrayData data =
executed (the execution status of this line is deduced): const QByteArrayData data =
-
1125 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset);
executed (the execution status of this line is deduced): { { { (-1) } }, size, 0, 0, offset };
-
1126 -
1127 memcpy(out + i * sizeof(QByteArrayData), &data, sizeof(QByteArrayData));
executed (the execution status of this line is deduced): memcpy(out + i * sizeof(QByteArrayData), &data, sizeof(QByteArrayData));
-
1128 -
1129 memcpy(out + offsetOfStringdataMember + stringdataOffset, str.constData(), size);
executed (the execution status of this line is deduced): memcpy(out + offsetOfStringdataMember + stringdataOffset, str.constData(), size);
-
1130 out[offsetOfStringdataMember + stringdataOffset + size] = '\0';
executed (the execution status of this line is deduced): out[offsetOfStringdataMember + stringdataOffset + size] = '\0';
-
1131 -
1132 stringdataOffset += size + 1;
executed (the execution status of this line is deduced): stringdataOffset += size + 1;
-
1133 }
executed: }
Execution Count:1984
1984
1134}
executed: }
Execution Count:151
151
1135 -
1136// Returns the sum of all parameters (including return type) for the given -
1137// \a methods. This is needed for calculating the size of the methods' -
1138// parameter type/name meta-data. -
1139static int aggregateParameterCount(const QList<QMetaMethodBuilderPrivate> &methods) -
1140{ -
1141 int sum = 0;
executed (the execution status of this line is deduced): int sum = 0;
-
1142 for (int i = 0; i < methods.size(); ++i)
evaluated: i < methods.size()
TRUEFALSE
yes
Evaluation Count:234
yes
Evaluation Count:68
68-234
1143 sum += methods.at(i).parameterCount() + 1; // +1 for return type
executed: sum += methods.at(i).parameterCount() + 1;
Execution Count:234
234
1144 return sum;
executed: return sum;
Execution Count:68
68
1145} -
1146 -
1147// Build a QMetaObject in "buf" based on the information in "d". -
1148// If "buf" is null, then return the number of bytes needed to -
1149// build the QMetaObject. Returns -1 if the metaobject if -
1150// relocatable is set, but the metaobject contains relatedMetaObjects. -
1151static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf, -
1152 int expectedSize, bool relocatable) -
1153{ -
1154 Q_UNUSED(expectedSize); // Avoid warning in release mode
executed (the execution status of this line is deduced): (void)expectedSize;;
-
1155 int size = 0;
executed (the execution status of this line is deduced): int size = 0;
-
1156 int dataIndex;
executed (the execution status of this line is deduced): int dataIndex;
-
1157 int paramsIndex;
executed (the execution status of this line is deduced): int paramsIndex;
-
1158 int enumIndex;
executed (the execution status of this line is deduced): int enumIndex;
-
1159 int index;
executed (the execution status of this line is deduced): int index;
-
1160 bool hasRevisionedMethods = d->hasRevisionedMethods();
executed (the execution status of this line is deduced): bool hasRevisionedMethods = d->hasRevisionedMethods();
-
1161 bool hasRevisionedProperties = d->hasRevisionedProperties();
executed (the execution status of this line is deduced): bool hasRevisionedProperties = d->hasRevisionedProperties();
-
1162 bool hasNotifySignals = false;
executed (the execution status of this line is deduced): bool hasNotifySignals = false;
-
1163 -
1164 if (relocatable &&
evaluated: relocatable
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:32
2-32
1165 (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction))
partially evaluated: d->relatedMetaObjects.size() > 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: d->staticMetacallFunction
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1166 return -1;
never executed: return -1;
0
1167 -
1168 // Create the main QMetaObject structure at the start of the buffer. -
1169 QMetaObject *meta = reinterpret_cast<QMetaObject *>(buf);
executed (the execution status of this line is deduced): QMetaObject *meta = reinterpret_cast<QMetaObject *>(buf);
-
1170 size += sizeof(QMetaObject);
executed (the execution status of this line is deduced): size += sizeof(QMetaObject);
-
1171 ALIGN(size, int);
executed (the execution status of this line is deduced): (size) = ((size) + sizeof(int) - 1) & ~(sizeof(int) - 1);
-
1172 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:17
17
1173 if (!relocatable) meta->d.superdata = d->superClass;
executed: meta->d.superdata = d->superClass;
Execution Count:16
evaluated: !relocatable
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:1
1-16
1174 meta->d.relatedMetaObjects = 0;
executed (the execution status of this line is deduced): meta->d.relatedMetaObjects = 0;
-
1175 meta->d.extradata = 0;
executed (the execution status of this line is deduced): meta->d.extradata = 0;
-
1176 meta->d.static_metacall = d->staticMetacallFunction;
executed (the execution status of this line is deduced): meta->d.static_metacall = d->staticMetacallFunction;
-
1177 }
executed: }
Execution Count:17
17
1178 -
1179 // Populate the QMetaObjectPrivate structure. -
1180 QMetaObjectPrivate *pmeta
executed (the execution status of this line is deduced): QMetaObjectPrivate *pmeta
-
1181 = reinterpret_cast<QMetaObjectPrivate *>(buf + size);
executed (the execution status of this line is deduced): = reinterpret_cast<QMetaObjectPrivate *>(buf + size);
-
1182 int pmetaSize = size;
executed (the execution status of this line is deduced): int pmetaSize = size;
-
1183 dataIndex = MetaObjectPrivateFieldCount;
executed (the execution status of this line is deduced): dataIndex = MetaObjectPrivateFieldCount;
-
1184 for (index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:4
4-32
1185 if (d->properties[index].notifySignal != -1) {
evaluated: d->properties[index].notifySignal != -1
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:2
2-30
1186 hasNotifySignals = true;
executed (the execution status of this line is deduced): hasNotifySignals = true;
-
1187 break;
executed: break;
Execution Count:30
30
1188 } -
1189 }
executed: }
Execution Count:2
2
1190 int methodParametersDataSize =
executed (the execution status of this line is deduced): int methodParametersDataSize =
-
1191 ((aggregateParameterCount(d->methods)
executed (the execution status of this line is deduced): ((aggregateParameterCount(d->methods)
-
1192 + aggregateParameterCount(d->constructors)) * 2) // types and parameter names
executed (the execution status of this line is deduced): + aggregateParameterCount(d->constructors)) * 2)
-
1193 - d->methods.size() // return "parameters" don't have names
executed (the execution status of this line is deduced): - d->methods.size()
-
1194 - d->constructors.size(); // "this" parameters don't have names
executed (the execution status of this line is deduced): - d->constructors.size();
-
1195 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:17
17
1196 Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7, "QMetaObjectBuilder should generate the same version as moc");
executed (the execution status of this line is deduced): static_assert(bool(QMetaObjectPrivate::OutputRevision == 7), "QMetaObjectBuilder should generate the same version as moc");
-
1197 pmeta->revision = QMetaObjectPrivate::OutputRevision;
executed (the execution status of this line is deduced): pmeta->revision = QMetaObjectPrivate::OutputRevision;
-
1198 pmeta->flags = d->flags;
executed (the execution status of this line is deduced): pmeta->flags = d->flags;
-
1199 pmeta->className = 0; // Class name is always the first string.
executed (the execution status of this line is deduced): pmeta->className = 0;
-
1200 //pmeta->signalCount is handled in the "output method loop" as an optimization. -
1201 -
1202 pmeta->classInfoCount = d->classInfoNames.size();
executed (the execution status of this line is deduced): pmeta->classInfoCount = d->classInfoNames.size();
-
1203 pmeta->classInfoData = dataIndex;
executed (the execution status of this line is deduced): pmeta->classInfoData = dataIndex;
-
1204 dataIndex += 2 * d->classInfoNames.size();
executed (the execution status of this line is deduced): dataIndex += 2 * d->classInfoNames.size();
-
1205 -
1206 pmeta->methodCount = d->methods.size();
executed (the execution status of this line is deduced): pmeta->methodCount = d->methods.size();
-
1207 pmeta->methodData = dataIndex;
executed (the execution status of this line is deduced): pmeta->methodData = dataIndex;
-
1208 dataIndex += 5 * d->methods.size();
executed (the execution status of this line is deduced): dataIndex += 5 * d->methods.size();
-
1209 if (hasRevisionedMethods)
evaluated: hasRevisionedMethods
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:14
3-14
1210 dataIndex += d->methods.size();
executed: dataIndex += d->methods.size();
Execution Count:3
3
1211 paramsIndex = dataIndex;
executed (the execution status of this line is deduced): paramsIndex = dataIndex;
-
1212 dataIndex += methodParametersDataSize;
executed (the execution status of this line is deduced): dataIndex += methodParametersDataSize;
-
1213 -
1214 pmeta->propertyCount = d->properties.size();
executed (the execution status of this line is deduced): pmeta->propertyCount = d->properties.size();
-
1215 pmeta->propertyData = dataIndex;
executed (the execution status of this line is deduced): pmeta->propertyData = dataIndex;
-
1216 dataIndex += 3 * d->properties.size();
executed (the execution status of this line is deduced): dataIndex += 3 * d->properties.size();
-
1217 if (hasNotifySignals)
evaluated: hasNotifySignals
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:2
2-15
1218 dataIndex += d->properties.size();
executed: dataIndex += d->properties.size();
Execution Count:15
15
1219 if (hasRevisionedProperties)
evaluated: hasRevisionedProperties
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:14
3-14
1220 dataIndex += d->properties.size();
executed: dataIndex += d->properties.size();
Execution Count:3
3
1221 -
1222 pmeta->enumeratorCount = d->enumerators.size();
executed (the execution status of this line is deduced): pmeta->enumeratorCount = d->enumerators.size();
-
1223 pmeta->enumeratorData = dataIndex;
executed (the execution status of this line is deduced): pmeta->enumeratorData = dataIndex;
-
1224 dataIndex += 4 * d->enumerators.size();
executed (the execution status of this line is deduced): dataIndex += 4 * d->enumerators.size();
-
1225 -
1226 pmeta->constructorCount = d->constructors.size();
executed (the execution status of this line is deduced): pmeta->constructorCount = d->constructors.size();
-
1227 pmeta->constructorData = dataIndex;
executed (the execution status of this line is deduced): pmeta->constructorData = dataIndex;
-
1228 dataIndex += 5 * d->constructors.size();
executed (the execution status of this line is deduced): dataIndex += 5 * d->constructors.size();
-
1229 } else {
executed: }
Execution Count:17
17
1230 dataIndex += 2 * d->classInfoNames.size();
executed (the execution status of this line is deduced): dataIndex += 2 * d->classInfoNames.size();
-
1231 dataIndex += 5 * d->methods.size();
executed (the execution status of this line is deduced): dataIndex += 5 * d->methods.size();
-
1232 if (hasRevisionedMethods)
evaluated: hasRevisionedMethods
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:14
3-14
1233 dataIndex += d->methods.size();
executed: dataIndex += d->methods.size();
Execution Count:3
3
1234 paramsIndex = dataIndex;
executed (the execution status of this line is deduced): paramsIndex = dataIndex;
-
1235 dataIndex += methodParametersDataSize;
executed (the execution status of this line is deduced): dataIndex += methodParametersDataSize;
-
1236 dataIndex += 3 * d->properties.size();
executed (the execution status of this line is deduced): dataIndex += 3 * d->properties.size();
-
1237 if (hasNotifySignals)
evaluated: hasNotifySignals
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:2
2-15
1238 dataIndex += d->properties.size();
executed: dataIndex += d->properties.size();
Execution Count:15
15
1239 if (hasRevisionedProperties)
evaluated: hasRevisionedProperties
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:14
3-14
1240 dataIndex += d->properties.size();
executed: dataIndex += d->properties.size();
Execution Count:3
3
1241 dataIndex += 4 * d->enumerators.size();
executed (the execution status of this line is deduced): dataIndex += 4 * d->enumerators.size();
-
1242 dataIndex += 5 * d->constructors.size();
executed (the execution status of this line is deduced): dataIndex += 5 * d->constructors.size();
-
1243 }
executed: }
Execution Count:17
17
1244 -
1245 // Allocate space for the enumerator key names and values. -
1246 enumIndex = dataIndex;
executed (the execution status of this line is deduced): enumIndex = dataIndex;
-
1247 for (index = 0; index < d->enumerators.size(); ++index) {
evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:34
12-34
1248 QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
-
1249 dataIndex += 2 * enumerator->keys.size();
executed (the execution status of this line is deduced): dataIndex += 2 * enumerator->keys.size();
-
1250 }
executed: }
Execution Count:12
12
1251 -
1252 // Zero terminator at the end of the data offset table. -
1253 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1254 -
1255 // Find the start of the data and string tables. -
1256 int *data = reinterpret_cast<int *>(pmeta);
executed (the execution status of this line is deduced): int *data = reinterpret_cast<int *>(pmeta);
-
1257 size += dataIndex * sizeof(int);
executed (the execution status of this line is deduced): size += dataIndex * sizeof(int);
-
1258 ALIGN(size, void *);
executed (the execution status of this line is deduced): (size) = ((size) + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
-
1259 char *str = reinterpret_cast<char *>(buf + size);
executed (the execution status of this line is deduced): char *str = reinterpret_cast<char *>(buf + size);
-
1260 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:17
17
1261 if (relocatable) {
evaluated: relocatable
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:16
1-16
1262 meta->d.stringdata = reinterpret_cast<const QByteArrayData *>((quintptr)size);
executed (the execution status of this line is deduced): meta->d.stringdata = reinterpret_cast<const QByteArrayData *>((quintptr)size);
-
1263 meta->d.data = reinterpret_cast<uint *>((quintptr)pmetaSize);
executed (the execution status of this line is deduced): meta->d.data = reinterpret_cast<uint *>((quintptr)pmetaSize);
-
1264 } else {
executed: }
Execution Count:1
1
1265 meta->d.stringdata = reinterpret_cast<const QByteArrayData *>(str);
executed (the execution status of this line is deduced): meta->d.stringdata = reinterpret_cast<const QByteArrayData *>(str);
-
1266 meta->d.data = reinterpret_cast<uint *>(data);
executed (the execution status of this line is deduced): meta->d.data = reinterpret_cast<uint *>(data);
-
1267 }
executed: }
Execution Count:16
16
1268 } -
1269 -
1270 // Reset the current data position to just past the QMetaObjectPrivate. -
1271 dataIndex = MetaObjectPrivateFieldCount;
executed (the execution status of this line is deduced): dataIndex = MetaObjectPrivateFieldCount;
-
1272 -
1273 QMetaStringTable strings;
executed (the execution status of this line is deduced): QMetaStringTable strings;
-
1274 strings.enter(d->className);
executed (the execution status of this line is deduced): strings.enter(d->className);
-
1275 -
1276 // Output the class infos, -
1277 Q_ASSERT(!buf || dataIndex == pmeta->classInfoData);
executed (the execution status of this line is deduced): qt_noop();
-
1278 for (index = 0; index < d->classInfoNames.size(); ++index) {
evaluated: index < d->classInfoNames.size()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:34
12-34
1279 int name = strings.enter(d->classInfoNames[index]);
executed (the execution status of this line is deduced): int name = strings.enter(d->classInfoNames[index]);
-
1280 int value = strings.enter(d->classInfoValues[index]);
executed (the execution status of this line is deduced): int value = strings.enter(d->classInfoValues[index]);
-
1281 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
6
1282 data[dataIndex] = name;
executed (the execution status of this line is deduced): data[dataIndex] = name;
-
1283 data[dataIndex + 1] = value;
executed (the execution status of this line is deduced): data[dataIndex + 1] = value;
-
1284 }
executed: }
Execution Count:6
6
1285 dataIndex += 2;
executed (the execution status of this line is deduced): dataIndex += 2;
-
1286 }
executed: }
Execution Count:12
12
1287 -
1288 // Output the methods in the class. -
1289 Q_ASSERT(!buf || dataIndex == pmeta->methodData);
executed (the execution status of this line is deduced): qt_noop();
-
1290 for (index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:188
yes
Evaluation Count:34
34-188
1291 QMetaMethodBuilderPrivate *method = &(d->methods[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(d->methods[index]);
-
1292 int name = strings.enter(method->name());
executed (the execution status of this line is deduced): int name = strings.enter(method->name());
-
1293 int argc = method->parameterCount();
executed (the execution status of this line is deduced): int argc = method->parameterCount();
-
1294 int tag = strings.enter(method->tag);
executed (the execution status of this line is deduced): int tag = strings.enter(method->tag);
-
1295 int attrs = method->attributes;
executed (the execution status of this line is deduced): int attrs = method->attributes;
-
1296 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:94
yes
Evaluation Count:94
94
1297 data[dataIndex] = name;
executed (the execution status of this line is deduced): data[dataIndex] = name;
-
1298 data[dataIndex + 1] = argc;
executed (the execution status of this line is deduced): data[dataIndex + 1] = argc;
-
1299 data[dataIndex + 2] = paramsIndex;
executed (the execution status of this line is deduced): data[dataIndex + 2] = paramsIndex;
-
1300 data[dataIndex + 3] = tag;
executed (the execution status of this line is deduced): data[dataIndex + 3] = tag;
-
1301 data[dataIndex + 4] = attrs;
executed (the execution status of this line is deduced): data[dataIndex + 4] = attrs;
-
1302 if (method->methodType() == QMetaMethod::Signal)
evaluated: method->methodType() == QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:71
23-71
1303 pmeta->signalCount++;
executed: pmeta->signalCount++;
Execution Count:23
23
1304 }
executed: }
Execution Count:94
94
1305 dataIndex += 5;
executed (the execution status of this line is deduced): dataIndex += 5;
-
1306 paramsIndex += 1 + argc * 2;
executed (the execution status of this line is deduced): paramsIndex += 1 + argc * 2;
-
1307 }
executed: }
Execution Count:188
188
1308 if (hasRevisionedMethods) {
evaluated: hasRevisionedMethods
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:28
6-28
1309 for (index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:6
6-60
1310 QMetaMethodBuilderPrivate *method = &(d->methods[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(d->methods[index]);
-
1311 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:30
30
1312 data[dataIndex] = method->revision;
executed: data[dataIndex] = method->revision;
Execution Count:30
30
1313 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1314 }
executed: }
Execution Count:60
60
1315 }
executed: }
Execution Count:6
6
1316 -
1317 // Output the method parameters in the class. -
1318 Q_ASSERT(!buf || dataIndex == pmeta->methodData + d->methods.size() * 5
executed (the execution status of this line is deduced): qt_noop();
-
1319 + (hasRevisionedMethods ? d->methods.size() : 0)); -
1320 for (int x = 0; x < 2; ++x) {
evaluated: x < 2
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:34
34-68
1321 QList<QMetaMethodBuilderPrivate> &methods = (x == 0) ? d->methods : d->constructors;
evaluated: (x == 0)
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:34
34
1322 for (index = 0; index < methods.size(); ++index) {
evaluated: index < methods.size()
TRUEFALSE
yes
Evaluation Count:234
yes
Evaluation Count:68
68-234
1323 QMetaMethodBuilderPrivate *method = &(methods[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(methods[index]);
-
1324 QList<QByteArray> paramTypeNames = method->parameterTypes();
executed (the execution status of this line is deduced): QList<QByteArray> paramTypeNames = method->parameterTypes();
-
1325 int paramCount = paramTypeNames.size();
executed (the execution status of this line is deduced): int paramCount = paramTypeNames.size();
-
1326 for (int i = -1; i < paramCount; ++i) {
evaluated: i < paramCount
TRUEFALSE
yes
Evaluation Count:402
yes
Evaluation Count:234
234-402
1327 const QByteArray &typeName = (i < 0) ? method->returnType : paramTypeNames.at(i);
evaluated: (i < 0)
TRUEFALSE
yes
Evaluation Count:234
yes
Evaluation Count:168
168-234
1328 int typeInfo;
executed (the execution status of this line is deduced): int typeInfo;
-
1329 if (QtPrivate::isBuiltinType(typeName))
partially evaluated: QtPrivate::isBuiltinType(typeName)
TRUEFALSE
yes
Evaluation Count:402
no
Evaluation Count:0
0-402
1330 typeInfo = QMetaType::type(typeName);
executed: typeInfo = QMetaType::type(typeName);
Execution Count:402
402
1331 else -
1332 typeInfo = IsUnresolvedType | strings.enter(typeName);
never executed: typeInfo = IsUnresolvedType | strings.enter(typeName);
0
1333 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:201
yes
Evaluation Count:201
201
1334 data[dataIndex] = typeInfo;
executed: data[dataIndex] = typeInfo;
Execution Count:201
201
1335 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1336 }
executed: }
Execution Count:402
402
1337 -
1338 QList<QByteArray> paramNames = method->parameterNames;
executed (the execution status of this line is deduced): QList<QByteArray> paramNames = method->parameterNames;
-
1339 while (paramNames.size() < paramCount)
evaluated: paramNames.size() < paramCount
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:234
18-234
1340 paramNames.append(QByteArray());
executed: paramNames.append(QByteArray());
Execution Count:18
18
1341 for (int i = 0; i < paramCount; ++i) {
evaluated: i < paramCount
TRUEFALSE
yes
Evaluation Count:168
yes
Evaluation Count:234
168-234
1342 int stringIndex = strings.enter(paramNames.at(i));
executed (the execution status of this line is deduced): int stringIndex = strings.enter(paramNames.at(i));
-
1343 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:84
84
1344 data[dataIndex] = stringIndex;
executed: data[dataIndex] = stringIndex;
Execution Count:84
84
1345 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1346 }
executed: }
Execution Count:168
168
1347 }
executed: }
Execution Count:234
234
1348 }
executed: }
Execution Count:68
68
1349 -
1350 // Output the properties in the class. -
1351 Q_ASSERT(!buf || dataIndex == pmeta->propertyData);
executed (the execution status of this line is deduced): qt_noop();
-
1352 for (index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:62
yes
Evaluation Count:34
34-62
1353 QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
-
1354 int name = strings.enter(prop->name);
executed (the execution status of this line is deduced): int name = strings.enter(prop->name);
-
1355 -
1356 int typeInfo;
executed (the execution status of this line is deduced): int typeInfo;
-
1357 if (QtPrivate::isBuiltinType(prop->type))
evaluated: QtPrivate::isBuiltinType(prop->type)
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:18
18-44
1358 typeInfo = QMetaType::type(prop->type);
executed: typeInfo = QMetaType::type(prop->type);
Execution Count:44
44
1359 else -
1360 typeInfo = IsUnresolvedType | strings.enter(prop->type);
executed: typeInfo = IsUnresolvedType | strings.enter(prop->type);
Execution Count:18
18
1361 -
1362 int flags = prop->flags;
executed (the execution status of this line is deduced): int flags = prop->flags;
-
1363 -
1364 if (!QtPrivate::isBuiltinType(prop->type))
evaluated: !QtPrivate::isBuiltinType(prop->type)
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:44
18-44
1365 flags |= EnumOrFlag;
executed: flags |= EnumOrFlag;
Execution Count:18
18
1366 -
1367 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:31
31
1368 data[dataIndex] = name;
executed (the execution status of this line is deduced): data[dataIndex] = name;
-
1369 data[dataIndex + 1] = typeInfo;
executed (the execution status of this line is deduced): data[dataIndex + 1] = typeInfo;
-
1370 data[dataIndex + 2] = flags;
executed (the execution status of this line is deduced): data[dataIndex + 2] = flags;
-
1371 }
executed: }
Execution Count:31
31
1372 dataIndex += 3;
executed (the execution status of this line is deduced): dataIndex += 3;
-
1373 }
executed: }
Execution Count:62
62
1374 if (hasNotifySignals) {
evaluated: hasNotifySignals
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:4
4-30
1375 for (index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:30
30-60
1376 QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
-
1377 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:30
30
1378 if (prop->notifySignal != -1)
evaluated: prop->notifySignal != -1
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:15
15
1379 data[dataIndex] = prop->notifySignal;
executed: data[dataIndex] = prop->notifySignal;
Execution Count:15
15
1380 else -
1381 data[dataIndex] = 0;
executed: data[dataIndex] = 0;
Execution Count:15
15
1382 } -
1383 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1384 }
executed: }
Execution Count:60
60
1385 }
executed: }
Execution Count:30
30
1386 if (hasRevisionedProperties) {
evaluated: hasRevisionedProperties
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:28
6-28
1387 for (index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:6
6-36
1388 QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
-
1389 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:18
18
1390 data[dataIndex] = prop->revision;
executed: data[dataIndex] = prop->revision;
Execution Count:18
18
1391 ++dataIndex;
executed (the execution status of this line is deduced): ++dataIndex;
-
1392 }
executed: }
Execution Count:36
36
1393 }
executed: }
Execution Count:6
6
1394 -
1395 // Output the enumerators in the class. -
1396 Q_ASSERT(!buf || dataIndex == pmeta->enumeratorData);
executed (the execution status of this line is deduced): qt_noop();
-
1397 for (index = 0; index < d->enumerators.size(); ++index) {
evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:34
12-34
1398 QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
-
1399 int name = strings.enter(enumerator->name);
executed (the execution status of this line is deduced): int name = strings.enter(enumerator->name);
-
1400 int isFlag = (int)(enumerator->isFlag);
executed (the execution status of this line is deduced): int isFlag = (int)(enumerator->isFlag);
-
1401 int count = enumerator->keys.size();
executed (the execution status of this line is deduced): int count = enumerator->keys.size();
-
1402 int enumOffset = enumIndex;
executed (the execution status of this line is deduced): int enumOffset = enumIndex;
-
1403 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
6
1404 data[dataIndex] = name;
executed (the execution status of this line is deduced): data[dataIndex] = name;
-
1405 data[dataIndex + 1] = isFlag;
executed (the execution status of this line is deduced): data[dataIndex + 1] = isFlag;
-
1406 data[dataIndex + 2] = count;
executed (the execution status of this line is deduced): data[dataIndex + 2] = count;
-
1407 data[dataIndex + 3] = enumOffset;
executed (the execution status of this line is deduced): data[dataIndex + 3] = enumOffset;
-
1408 }
executed: }
Execution Count:6
6
1409 for (int key = 0; key < count; ++key) {
evaluated: key < count
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:12
12-24
1410 int keyIndex = strings.enter(enumerator->keys[key]);
executed (the execution status of this line is deduced): int keyIndex = strings.enter(enumerator->keys[key]);
-
1411 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:12
12
1412 data[enumOffset++] = keyIndex;
executed (the execution status of this line is deduced): data[enumOffset++] = keyIndex;
-
1413 data[enumOffset++] = enumerator->values[key];
executed (the execution status of this line is deduced): data[enumOffset++] = enumerator->values[key];
-
1414 }
executed: }
Execution Count:12
12
1415 }
executed: }
Execution Count:24
24
1416 dataIndex += 4;
executed (the execution status of this line is deduced): dataIndex += 4;
-
1417 enumIndex += 2 * count;
executed (the execution status of this line is deduced): enumIndex += 2 * count;
-
1418 }
executed: }
Execution Count:12
12
1419 -
1420 // Output the constructors in the class. -
1421 Q_ASSERT(!buf || dataIndex == pmeta->constructorData);
executed (the execution status of this line is deduced): qt_noop();
-
1422 for (index = 0; index < d->constructors.size(); ++index) {
evaluated: index < d->constructors.size()
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:34
34-46
1423 QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
-
1424 int name = strings.enter(method->name());
executed (the execution status of this line is deduced): int name = strings.enter(method->name());
-
1425 int argc = method->parameterCount();
executed (the execution status of this line is deduced): int argc = method->parameterCount();
-
1426 int tag = strings.enter(method->tag);
executed (the execution status of this line is deduced): int tag = strings.enter(method->tag);
-
1427 int attrs = method->attributes;
executed (the execution status of this line is deduced): int attrs = method->attributes;
-
1428 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:23
23
1429 data[dataIndex] = name;
executed (the execution status of this line is deduced): data[dataIndex] = name;
-
1430 data[dataIndex + 1] = argc;
executed (the execution status of this line is deduced): data[dataIndex + 1] = argc;
-
1431 data[dataIndex + 2] = paramsIndex;
executed (the execution status of this line is deduced): data[dataIndex + 2] = paramsIndex;
-
1432 data[dataIndex + 3] = tag;
executed (the execution status of this line is deduced): data[dataIndex + 3] = tag;
-
1433 data[dataIndex + 4] = attrs;
executed (the execution status of this line is deduced): data[dataIndex + 4] = attrs;
-
1434 }
executed: }
Execution Count:23
23
1435 dataIndex += 5;
executed (the execution status of this line is deduced): dataIndex += 5;
-
1436 paramsIndex += 1 + argc * 2;
executed (the execution status of this line is deduced): paramsIndex += 1 + argc * 2;
-
1437 }
executed: }
Execution Count:46
46
1438 -
1439 size += strings.blobSize();
executed (the execution status of this line is deduced): size += strings.blobSize();
-
1440 -
1441 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:17
17
1442 strings.writeBlob(str);
executed: strings.writeBlob(str);
Execution Count:17
17
1443 -
1444 // Output the zero terminator in the data array. -
1445 if (buf)
evaluated: buf
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:17
17
1446 data[enumIndex] = 0;
executed: data[enumIndex] = 0;
Execution Count:17
17
1447 -
1448 // Create the relatedMetaObjects block if we need one. -
1449 if (d->relatedMetaObjects.size() > 0) {
evaluated: d->relatedMetaObjects.size() > 0
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:28
6-28
1450 ALIGN(size, QMetaObject *);
executed (the execution status of this line is deduced): (size) = ((size) + sizeof(QMetaObject *) - 1) & ~(sizeof(QMetaObject *) - 1);
-
1451 const QMetaObject **objects =
executed (the execution status of this line is deduced): const QMetaObject **objects =
-
1452 reinterpret_cast<const QMetaObject **>(buf + size);
executed (the execution status of this line is deduced): reinterpret_cast<const QMetaObject **>(buf + size);
-
1453 if (buf) {
evaluated: buf
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1454 meta->d.relatedMetaObjects = objects;
executed (the execution status of this line is deduced): meta->d.relatedMetaObjects = objects;
-
1455 for (index = 0; index < d->relatedMetaObjects.size(); ++index)
evaluated: index < d->relatedMetaObjects.size()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1456 objects[index] = d->relatedMetaObjects[index];
executed: objects[index] = d->relatedMetaObjects[index];
Execution Count:3
3
1457 objects[index] = 0;
executed (the execution status of this line is deduced): objects[index] = 0;
-
1458 }
executed: }
Execution Count:3
3
1459 size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
executed (the execution status of this line is deduced): size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
-
1460 }
executed: }
Execution Count:6
6
1461 -
1462 // Align the final size and return it. -
1463 ALIGN(size, void *);
executed (the execution status of this line is deduced): (size) = ((size) + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
-
1464 Q_ASSERT(!buf || size == expectedSize);
executed (the execution status of this line is deduced): qt_noop();
-
1465 return size;
executed: return size;
Execution Count:34
34
1466} -
1467 -
1468/*! -
1469 Converts this meta object builder into a concrete QMetaObject. -
1470 The return value should be deallocated using free() once it -
1471 is no longer needed. -
1472 -
1473 The returned meta object is a snapshot of the state of the -
1474 QMetaObjectBuilder. Any further modifications to the QMetaObjectBuilder -
1475 will not be reflected in previous meta objects returned by -
1476 this method. -
1477*/ -
1478QMetaObject *QMetaObjectBuilder::toMetaObject() const -
1479{ -
1480 int size = buildMetaObject(d, 0, 0, false);
executed (the execution status of this line is deduced): int size = buildMetaObject(d, 0, 0, false);
-
1481 char *buf = reinterpret_cast<char *>(malloc(size));
executed (the execution status of this line is deduced): char *buf = reinterpret_cast<char *>(malloc(size));
-
1482 memset(buf, 0, size);
executed (the execution status of this line is deduced): memset(buf, 0, size);
-
1483 buildMetaObject(d, buf, size, false);
executed (the execution status of this line is deduced): buildMetaObject(d, buf, size, false);
-
1484 return reinterpret_cast<QMetaObject *>(buf);
executed: return reinterpret_cast<QMetaObject *>(buf);
Execution Count:16
16
1485} -
1486 -
1487/* -
1488 \internal -
1489 -
1490 Converts this meta object builder into relocatable data. This data can -
1491 be stored, copied and later passed to fromRelocatableData() to create a -
1492 concrete QMetaObject. -
1493 -
1494 The data is specific to the architecture on which it was created, but is not -
1495 specific to the process that created it. Not all meta object builder's can -
1496 be converted to data in this way. If \a ok is provided, it will be set to -
1497 true if the conversion succeeds, and false otherwise. If a -
1498 staticMetacallFunction() or any relatedMetaObject()'s are specified the -
1499 conversion to relocatable data will fail. -
1500*/ -
1501QByteArray QMetaObjectBuilder::toRelocatableData(bool *ok) const -
1502{ -
1503 int size = buildMetaObject(d, 0, 0, true);
executed (the execution status of this line is deduced): int size = buildMetaObject(d, 0, 0, true);
-
1504 if (size == -1) {
partially evaluated: size == -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1505 if (ok) *ok = false;
never executed: *ok = false;
never evaluated: ok
0
1506 return QByteArray();
never executed: return QByteArray();
0
1507 } -
1508 -
1509 QByteArray data;
executed (the execution status of this line is deduced): QByteArray data;
-
1510 data.resize(size);
executed (the execution status of this line is deduced): data.resize(size);
-
1511 char *buf = data.data();
executed (the execution status of this line is deduced): char *buf = data.data();
-
1512 memset(buf, 0, size);
executed (the execution status of this line is deduced): memset(buf, 0, size);
-
1513 buildMetaObject(d, buf, size, true);
executed (the execution status of this line is deduced): buildMetaObject(d, buf, size, true);
-
1514 if (ok) *ok = true;
executed: *ok = true;
Execution Count:1
partially evaluated: ok
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1515 return data;
executed: return data;
Execution Count:1
1
1516} -
1517 -
1518/* -
1519 \internal -
1520 -
1521 Sets the \a data returned from toRelocatableData() onto a concrete -
1522 QMetaObject instance, \a output. As the meta object's super class is not -
1523 saved in the relocatable data, it must be passed as \a superClass. -
1524*/ -
1525void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output, -
1526 const QMetaObject *superclass, -
1527 const QByteArray &data) -
1528{ -
1529 if (!output)
partially evaluated: !output
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1530 return;
never executed: return;
0
1531 -
1532 const char *buf = data.constData();
executed (the execution status of this line is deduced): const char *buf = data.constData();
-
1533 const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf);
executed (the execution status of this line is deduced): const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf);
-
1534 -
1535 quintptr stringdataOffset = (quintptr)dataMo->d.stringdata;
executed (the execution status of this line is deduced): quintptr stringdataOffset = (quintptr)dataMo->d.stringdata;
-
1536 quintptr dataOffset = (quintptr)dataMo->d.data;
executed (the execution status of this line is deduced): quintptr dataOffset = (quintptr)dataMo->d.data;
-
1537 -
1538 output->d.superdata = superclass;
executed (the execution status of this line is deduced): output->d.superdata = superclass;
-
1539 output->d.stringdata = reinterpret_cast<const QByteArrayData *>(buf + stringdataOffset);
executed (the execution status of this line is deduced): output->d.stringdata = reinterpret_cast<const QByteArrayData *>(buf + stringdataOffset);
-
1540 output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
executed (the execution status of this line is deduced): output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
-
1541 output->d.extradata = 0;
executed (the execution status of this line is deduced): output->d.extradata = 0;
-
1542 output->d.relatedMetaObjects = 0;
executed (the execution status of this line is deduced): output->d.relatedMetaObjects = 0;
-
1543 output->d.static_metacall = 0;
executed (the execution status of this line is deduced): output->d.static_metacall = 0;
-
1544}
executed: }
Execution Count:1
1
1545 -
1546/*! -
1547 \typedef QMetaObjectBuilder::StaticMetacallFunction -
1548 -
1549 Typedef for static metacall functions. The three parameters are -
1550 the call type value, the constructor index, and the -
1551 array of parameters. -
1552*/ -
1553 -
1554/*! -
1555 Returns the static metacall function to use to construct objects -
1556 of this class. The default value is null. -
1557 -
1558 \sa setStaticMetacallFunction() -
1559*/ -
1560QMetaObjectBuilder::StaticMetacallFunction QMetaObjectBuilder::staticMetacallFunction() const -
1561{ -
1562 return d->staticMetacallFunction;
executed: return d->staticMetacallFunction;
Execution Count:15
15
1563} -
1564 -
1565/*! -
1566 Sets the static metacall function to use to construct objects -
1567 of this class to \a value. The default value is null. -
1568 -
1569 \sa staticMetacallFunction() -
1570*/ -
1571void QMetaObjectBuilder::setStaticMetacallFunction -
1572 (QMetaObjectBuilder::StaticMetacallFunction value) -
1573{ -
1574 d->staticMetacallFunction = value;
executed (the execution status of this line is deduced): d->staticMetacallFunction = value;
-
1575}
executed: }
Execution Count:15
15
1576 -
1577#ifndef QT_NO_DATASTREAM -
1578 -
1579/*! -
1580 Serializes the contents of the meta object builder onto \a stream. -
1581 -
1582 \sa deserialize() -
1583*/ -
1584void QMetaObjectBuilder::serialize(QDataStream& stream) const -
1585{ -
1586 int index;
executed (the execution status of this line is deduced): int index;
-
1587 -
1588 // Write the class and super class names. -
1589 stream << d->className;
executed (the execution status of this line is deduced): stream << d->className;
-
1590 if (d->superClass)
partially evaluated: d->superClass
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1591 stream << QByteArray(d->superClass->className());
executed: stream << QByteArray(d->superClass->className());
Execution Count:2
2
1592 else -
1593 stream << QByteArray();
never executed: stream << QByteArray();
0
1594 -
1595 // Write the counts for each type of class member. -
1596 stream << d->classInfoNames.size();
executed (the execution status of this line is deduced): stream << d->classInfoNames.size();
-
1597 stream << d->methods.size();
executed (the execution status of this line is deduced): stream << d->methods.size();
-
1598 stream << d->properties.size();
executed (the execution status of this line is deduced): stream << d->properties.size();
-
1599 stream << d->enumerators.size();
executed (the execution status of this line is deduced): stream << d->enumerators.size();
-
1600 stream << d->constructors.size();
executed (the execution status of this line is deduced): stream << d->constructors.size();
-
1601 stream << d->relatedMetaObjects.size();
executed (the execution status of this line is deduced): stream << d->relatedMetaObjects.size();
-
1602 -
1603 // Write the items of class information. -
1604 for (index = 0; index < d->classInfoNames.size(); ++index) {
evaluated: index < d->classInfoNames.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1605 stream << d->classInfoNames[index];
executed (the execution status of this line is deduced): stream << d->classInfoNames[index];
-
1606 stream << d->classInfoValues[index];
executed (the execution status of this line is deduced): stream << d->classInfoValues[index];
-
1607 }
executed: }
Execution Count:2
2
1608 -
1609 // Write the methods. -
1610 for (index = 0; index < d->methods.size(); ++index) {
evaluated: index < d->methods.size()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:2
2-10
1611 const QMetaMethodBuilderPrivate *method = &(d->methods[index]);
executed (the execution status of this line is deduced): const QMetaMethodBuilderPrivate *method = &(d->methods[index]);
-
1612 stream << method->signature;
executed (the execution status of this line is deduced): stream << method->signature;
-
1613 stream << method->returnType;
executed (the execution status of this line is deduced): stream << method->returnType;
-
1614 stream << method->parameterNames;
executed (the execution status of this line is deduced): stream << method->parameterNames;
-
1615 stream << method->tag;
executed (the execution status of this line is deduced): stream << method->tag;
-
1616 stream << method->attributes;
executed (the execution status of this line is deduced): stream << method->attributes;
-
1617 if (method->revision)
evaluated: method->revision
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:9
1-9
1618 stream << method->revision;
executed: stream << method->revision;
Execution Count:1
1
1619 }
executed: }
Execution Count:10
10
1620 -
1621 // Write the properties. -
1622 for (index = 0; index < d->properties.size(); ++index) {
evaluated: index < d->properties.size()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:2
2-7
1623 const QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
executed (the execution status of this line is deduced): const QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
-
1624 stream << property->name;
executed (the execution status of this line is deduced): stream << property->name;
-
1625 stream << property->type;
executed (the execution status of this line is deduced): stream << property->type;
-
1626 stream << property->flags;
executed (the execution status of this line is deduced): stream << property->flags;
-
1627 stream << property->notifySignal;
executed (the execution status of this line is deduced): stream << property->notifySignal;
-
1628 if (property->revision)
evaluated: property->revision
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
1-6
1629 stream << property->revision;
executed: stream << property->revision;
Execution Count:1
1
1630 }
executed: }
Execution Count:7
7
1631 -
1632 // Write the enumerators. -
1633 for (index = 0; index < d->enumerators.size(); ++index) {
evaluated: index < d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1634 const QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
executed (the execution status of this line is deduced): const QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
-
1635 stream << enumerator->name;
executed (the execution status of this line is deduced): stream << enumerator->name;
-
1636 stream << enumerator->isFlag;
executed (the execution status of this line is deduced): stream << enumerator->isFlag;
-
1637 stream << enumerator->keys;
executed (the execution status of this line is deduced): stream << enumerator->keys;
-
1638 stream << enumerator->values;
executed (the execution status of this line is deduced): stream << enumerator->values;
-
1639 }
executed: }
Execution Count:2
2
1640 -
1641 // Write the constructors. -
1642 for (index = 0; index < d->constructors.size(); ++index) {
evaluated: index < d->constructors.size()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
1643 const QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
executed (the execution status of this line is deduced): const QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
-
1644 stream << method->signature;
executed (the execution status of this line is deduced): stream << method->signature;
-
1645 stream << method->returnType;
executed (the execution status of this line is deduced): stream << method->returnType;
-
1646 stream << method->parameterNames;
executed (the execution status of this line is deduced): stream << method->parameterNames;
-
1647 stream << method->tag;
executed (the execution status of this line is deduced): stream << method->tag;
-
1648 stream << method->attributes;
executed (the execution status of this line is deduced): stream << method->attributes;
-
1649 }
executed: }
Execution Count:1
1
1650 -
1651 // Write the related meta objects. -
1652 for (index = 0; index < d->relatedMetaObjects.size(); ++index) {
evaluated: index < d->relatedMetaObjects.size()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
1653 const QMetaObject *meta = d->relatedMetaObjects[index];
executed (the execution status of this line is deduced): const QMetaObject *meta = d->relatedMetaObjects[index];
-
1654 stream << QByteArray(meta->className());
executed (the execution status of this line is deduced): stream << QByteArray(meta->className());
-
1655 }
executed: }
Execution Count:1
1
1656 -
1657 // Add an extra empty QByteArray for additional data in future versions. -
1658 // This should help maintain backwards compatibility, allowing older -
1659 // versions to read newer data. -
1660 stream << QByteArray();
executed (the execution status of this line is deduced): stream << QByteArray();
-
1661}
executed: }
Execution Count:2
2
1662 -
1663// Resolve a class name using the name reference map. -
1664static const QMetaObject *resolveClassName -
1665 (const QMap<QByteArray, const QMetaObject *>& references, -
1666 const QByteArray& name) -
1667{ -
1668 if (name == QByteArray("QObject"))
evaluated: name == QByteArray("QObject")
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
1669 return &QObject::staticMetaObject;
executed: return &QObject::staticMetaObject;
Execution Count:2
2
1670 else -
1671 return references.value(name, 0);
executed: return references.value(name, 0);
Execution Count:1
1
1672} -
1673 -
1674/*! -
1675 Deserializes a meta object builder from \a stream into -
1676 this meta object builder. -
1677 -
1678 The \a references parameter specifies a mapping from class names -
1679 to QMetaObject instances for resolving the super class name and -
1680 related meta objects in the object that is deserialized. -
1681 The meta object for QObject is implicitly added to \a references -
1682 and does not need to be supplied. -
1683 -
1684 The QDataStream::status() value on \a stream will be set to -
1685 QDataStream::ReadCorruptData if the input data is corrupt. -
1686 The status will be set to QDataStream::ReadPastEnd if the -
1687 input was exhausted before the full meta object was read. -
1688 -
1689 \sa serialize() -
1690*/ -
1691void QMetaObjectBuilder::deserialize -
1692 (QDataStream& stream, -
1693 const QMap<QByteArray, const QMetaObject *>& references) -
1694{ -
1695 QByteArray name;
executed (the execution status of this line is deduced): QByteArray name;
-
1696 const QMetaObject *cl;
executed (the execution status of this line is deduced): const QMetaObject *cl;
-
1697 int index;
executed (the execution status of this line is deduced): int index;
-
1698 -
1699 // Clear all members in the builder to their default states. -
1700 d->className.clear();
executed (the execution status of this line is deduced): d->className.clear();
-
1701 d->superClass = &QObject::staticMetaObject;
executed (the execution status of this line is deduced): d->superClass = &QObject::staticMetaObject;
-
1702 d->classInfoNames.clear();
executed (the execution status of this line is deduced): d->classInfoNames.clear();
-
1703 d->classInfoValues.clear();
executed (the execution status of this line is deduced): d->classInfoValues.clear();
-
1704 d->methods.clear();
executed (the execution status of this line is deduced): d->methods.clear();
-
1705 d->properties.clear();
executed (the execution status of this line is deduced): d->properties.clear();
-
1706 d->enumerators.clear();
executed (the execution status of this line is deduced): d->enumerators.clear();
-
1707 d->constructors.clear();
executed (the execution status of this line is deduced): d->constructors.clear();
-
1708 d->relatedMetaObjects.clear();
executed (the execution status of this line is deduced): d->relatedMetaObjects.clear();
-
1709 d->staticMetacallFunction = 0;
executed (the execution status of this line is deduced): d->staticMetacallFunction = 0;
-
1710 -
1711 // Read the class and super class names. -
1712 stream >> d->className;
executed (the execution status of this line is deduced): stream >> d->className;
-
1713 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1714 if (name.isEmpty()) {
partially evaluated: name.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1715 d->superClass = 0;
never executed (the execution status of this line is deduced): d->superClass = 0;
-
1716 } else if ((cl = resolveClassName(references, name)) != 0) {
never executed: }
partially evaluated: (cl = resolveClassName(references, name)) != 0
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1717 d->superClass = cl;
executed (the execution status of this line is deduced): d->superClass = cl;
-
1718 } else {
executed: }
Execution Count:2
2
1719 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1720 return;
never executed: return;
0
1721 } -
1722 -
1723 // Read the counts for each type of class member. -
1724 int classInfoCount, methodCount, propertyCount;
executed (the execution status of this line is deduced): int classInfoCount, methodCount, propertyCount;
-
1725 int enumeratorCount, constructorCount, relatedMetaObjectCount;
executed (the execution status of this line is deduced): int enumeratorCount, constructorCount, relatedMetaObjectCount;
-
1726 stream >> classInfoCount;
executed (the execution status of this line is deduced): stream >> classInfoCount;
-
1727 stream >> methodCount;
executed (the execution status of this line is deduced): stream >> methodCount;
-
1728 stream >> propertyCount;
executed (the execution status of this line is deduced): stream >> propertyCount;
-
1729 stream >> enumeratorCount;
executed (the execution status of this line is deduced): stream >> enumeratorCount;
-
1730 stream >> constructorCount;
executed (the execution status of this line is deduced): stream >> constructorCount;
-
1731 stream >> relatedMetaObjectCount;
executed (the execution status of this line is deduced): stream >> relatedMetaObjectCount;
-
1732 if (classInfoCount < 0 || methodCount < 0 ||
partially evaluated: classInfoCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: methodCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1733 propertyCount < 0 || enumeratorCount < 0 ||
partially evaluated: propertyCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: enumeratorCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1734 constructorCount < 0 || relatedMetaObjectCount < 0) {
partially evaluated: constructorCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: relatedMetaObjectCount < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1735 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1736 return;
never executed: return;
0
1737 } -
1738 -
1739 // Read the items of class information. -
1740 for (index = 0; index < classInfoCount; ++index) {
evaluated: index < classInfoCount
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1741 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1742 return;
never executed: return;
0
1743 QByteArray value;
executed (the execution status of this line is deduced): QByteArray value;
-
1744 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1745 stream >> value;
executed (the execution status of this line is deduced): stream >> value;
-
1746 addClassInfo(name, value);
executed (the execution status of this line is deduced): addClassInfo(name, value);
-
1747 }
executed: }
Execution Count:2
2
1748 -
1749 // Read the member methods. -
1750 for (index = 0; index < methodCount; ++index) {
evaluated: index < methodCount
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:2
2-10
1751 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
1752 return;
never executed: return;
0
1753 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1754 addMethod(name);
executed (the execution status of this line is deduced): addMethod(name);
-
1755 QMetaMethodBuilderPrivate *method = &(d->methods[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(d->methods[index]);
-
1756 stream >> method->returnType;
executed (the execution status of this line is deduced): stream >> method->returnType;
-
1757 stream >> method->parameterNames;
executed (the execution status of this line is deduced): stream >> method->parameterNames;
-
1758 stream >> method->tag;
executed (the execution status of this line is deduced): stream >> method->tag;
-
1759 stream >> method->attributes;
executed (the execution status of this line is deduced): stream >> method->attributes;
-
1760 if (method->attributes & MethodRevisioned)
evaluated: method->attributes & MethodRevisioned
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:9
1-9
1761 stream >> method->revision;
executed: stream >> method->revision;
Execution Count:1
1
1762 if (method->methodType() == QMetaMethod::Constructor) {
partially evaluated: method->methodType() == QMetaMethod::Constructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
1763 // Cannot add a constructor in this set of methods. -
1764 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1765 return;
never executed: return;
0
1766 } -
1767 }
executed: }
Execution Count:10
10
1768 -
1769 // Read the properties. -
1770 for (index = 0; index < propertyCount; ++index) {
evaluated: index < propertyCount
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:2
2-7
1771 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1772 return;
never executed: return;
0
1773 QByteArray type;
executed (the execution status of this line is deduced): QByteArray type;
-
1774 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1775 stream >> type;
executed (the execution status of this line is deduced): stream >> type;
-
1776 addProperty(name, type);
executed (the execution status of this line is deduced): addProperty(name, type);
-
1777 QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
-
1778 stream >> property->flags;
executed (the execution status of this line is deduced): stream >> property->flags;
-
1779 stream >> property->notifySignal;
executed (the execution status of this line is deduced): stream >> property->notifySignal;
-
1780 if (property->notifySignal < -1 ||
partially evaluated: property->notifySignal < -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1781 property->notifySignal >= d->methods.size()) {
partially evaluated: property->notifySignal >= d->methods.size()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1782 // Notify signal method index is out of range. -
1783 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1784 return;
never executed: return;
0
1785 } -
1786 if (property->notifySignal >= 0 &&
evaluated: property->notifySignal >= 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
1-6
1787 d->methods[property->notifySignal].methodType() != QMetaMethod::Signal) {
partially evaluated: d->methods[property->notifySignal].methodType() != QMetaMethod::Signal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1788 // Notify signal method index does not refer to a signal. -
1789 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1790 return;
never executed: return;
0
1791 } -
1792 if (property->flags & Revisioned)
evaluated: property->flags & Revisioned
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
1-6
1793 stream >> property->revision;
executed: stream >> property->revision;
Execution Count:1
1
1794 }
executed: }
Execution Count:7
7
1795 -
1796 // Read the enumerators. -
1797 for (index = 0; index < enumeratorCount; ++index) {
evaluated: index < enumeratorCount
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1798 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1799 return;
never executed: return;
0
1800 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1801 addEnumerator(name);
executed (the execution status of this line is deduced): addEnumerator(name);
-
1802 QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
-
1803 stream >> enumerator->isFlag;
executed (the execution status of this line is deduced): stream >> enumerator->isFlag;
-
1804 stream >> enumerator->keys;
executed (the execution status of this line is deduced): stream >> enumerator->keys;
-
1805 stream >> enumerator->values;
executed (the execution status of this line is deduced): stream >> enumerator->values;
-
1806 if (enumerator->keys.size() != enumerator->values.size()) {
partially evaluated: enumerator->keys.size() != enumerator->values.size()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1807 // Mismatch between number of keys and number of values. -
1808 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1809 return;
never executed: return;
0
1810 } -
1811 }
executed: }
Execution Count:2
2
1812 -
1813 // Read the constructor methods. -
1814 for (index = 0; index < constructorCount; ++index) {
evaluated: index < constructorCount
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
1815 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1816 return;
never executed: return;
0
1817 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1818 addConstructor(name);
executed (the execution status of this line is deduced): addConstructor(name);
-
1819 QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
-
1820 stream >> method->returnType;
executed (the execution status of this line is deduced): stream >> method->returnType;
-
1821 stream >> method->parameterNames;
executed (the execution status of this line is deduced): stream >> method->parameterNames;
-
1822 stream >> method->tag;
executed (the execution status of this line is deduced): stream >> method->tag;
-
1823 stream >> method->attributes;
executed (the execution status of this line is deduced): stream >> method->attributes;
-
1824 if (method->methodType() != QMetaMethod::Constructor) {
partially evaluated: method->methodType() != QMetaMethod::Constructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1825 // The type must be Constructor. -
1826 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1827 return;
never executed: return;
0
1828 } -
1829 }
executed: }
Execution Count:1
1
1830 -
1831 // Read the related meta objects. -
1832 for (index = 0; index < relatedMetaObjectCount; ++index) {
evaluated: index < relatedMetaObjectCount
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
1833 if (stream.status() != QDataStream::Ok)
partially evaluated: stream.status() != QDataStream::Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1834 return;
never executed: return;
0
1835 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1836 cl = resolveClassName(references, name);
executed (the execution status of this line is deduced): cl = resolveClassName(references, name);
-
1837 if (!cl) {
partially evaluated: !cl
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1838 stream.setStatus(QDataStream::ReadCorruptData);
never executed (the execution status of this line is deduced): stream.setStatus(QDataStream::ReadCorruptData);
-
1839 return;
never executed: return;
0
1840 } -
1841 addRelatedMetaObject(cl);
executed (the execution status of this line is deduced): addRelatedMetaObject(cl);
-
1842 }
executed: }
Execution Count:1
1
1843 -
1844 // Read the extra data block, which is reserved for future use. -
1845 stream >> name;
executed (the execution status of this line is deduced): stream >> name;
-
1846}
executed: }
Execution Count:2
2
1847 -
1848#endif // !QT_NO_DATASTREAM -
1849 -
1850/*! -
1851 \class QMetaMethodBuilder -
1852 \inmodule QtCore -
1853 \internal -
1854 \brief The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder. -
1855*/ -
1856 -
1857QMetaMethodBuilderPrivate *QMetaMethodBuilder::d_func() const -
1858{ -
1859 // Positive indices indicate methods, negative indices indicate constructors. -
1860 if (_mobj && _index >= 0 && _index < _mobj->d->methods.size())
evaluated: _mobj
TRUEFALSE
yes
Evaluation Count:560
yes
Evaluation Count:11
evaluated: _index >= 0
TRUEFALSE
yes
Evaluation Count:462
yes
Evaluation Count:98
partially evaluated: _index < _mobj->d->methods.size()
TRUEFALSE
yes
Evaluation Count:462
no
Evaluation Count:0
0-560
1861 return &(_mobj->d->methods[_index]);
executed: return &(_mobj->d->methods[_index]);
Execution Count:462
462
1862 else if (_mobj && -_index >= 1 && -_index <= _mobj->d->constructors.size())
evaluated: _mobj
TRUEFALSE
yes
Evaluation Count:98
yes
Evaluation Count:11
partially evaluated: -_index >= 1
TRUEFALSE
yes
Evaluation Count:98
no
Evaluation Count:0
partially evaluated: -_index <= _mobj->d->constructors.size()
TRUEFALSE
yes
Evaluation Count:98
no
Evaluation Count:0
0-98
1863 return &(_mobj->d->constructors[(-_index) - 1]);
executed: return &(_mobj->d->constructors[(-_index) - 1]);
Execution Count:98
98
1864 else -
1865 return 0;
executed: return 0;
Execution Count:11
11
1866} -
1867 -
1868/*! -
1869 \fn QMetaMethodBuilder::QMetaMethodBuilder() -
1870 \internal -
1871*/ -
1872 -
1873/*! -
1874 Returns the index of this method within its QMetaObjectBuilder. -
1875*/ -
1876int QMetaMethodBuilder::index() const -
1877{ -
1878 if (_index >= 0)
evaluated: _index >= 0
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:8
8-19
1879 return _index; // Method, signal, or slot
executed: return _index;
Execution Count:19
19
1880 else -
1881 return (-_index) - 1; // Constructor
executed: return (-_index) - 1;
Execution Count:8
8
1882} -
1883 -
1884/*! -
1885 Returns the type of this method (signal, slot, method, or constructor). -
1886*/ -
1887QMetaMethod::MethodType QMetaMethodBuilder::methodType() const -
1888{ -
1889 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1890 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:1
1-19
1891 return d->methodType();
executed: return d->methodType();
Execution Count:19
19
1892 else -
1893 return QMetaMethod::Method;
executed: return QMetaMethod::Method;
Execution Count:1
1
1894} -
1895 -
1896/*! -
1897 Returns the signature of this method. -
1898 -
1899 \sa parameterNames(), returnType() -
1900*/ -
1901QByteArray QMetaMethodBuilder::signature() const -
1902{ -
1903 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1904 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:3
3-23
1905 return d->signature;
executed: return d->signature;
Execution Count:23
23
1906 else -
1907 return QByteArray();
executed: return QByteArray();
Execution Count:3
3
1908} -
1909 -
1910/*! -
1911 Returns the return type for this method; empty if the method's -
1912 return type is \c{void}. -
1913 -
1914 \sa setReturnType(), signature() -
1915*/ -
1916QByteArray QMetaMethodBuilder::returnType() const -
1917{ -
1918 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1919 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:1
1-19
1920 return d->returnType;
executed: return d->returnType;
Execution Count:19
19
1921 else -
1922 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
1923} -
1924 -
1925/*! -
1926 Sets the return type for this method to \a value. If \a value -
1927 is empty, then the method's return type is \c{void}. The \a value -
1928 will be normalized before it is added to the method. -
1929 -
1930 \sa returnType(), parameterTypes(), signature() -
1931*/ -
1932void QMetaMethodBuilder::setReturnType(const QByteArray& value) -
1933{ -
1934 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1935 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:71
no
Evaluation Count:0
0-71
1936 d->returnType = QMetaObject::normalizedType(value);
executed: d->returnType = QMetaObject::normalizedType(value);
Execution Count:71
71
1937}
executed: }
Execution Count:71
71
1938 -
1939/*! -
1940 Returns the list of parameter types for this method. -
1941 -
1942 \sa returnType(), parameterNames() -
1943*/ -
1944QList<QByteArray> QMetaMethodBuilder::parameterTypes() const -
1945{ -
1946 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1947 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:1
1-19
1948 return d->parameterTypes();
executed: return d->parameterTypes();
Execution Count:19
19
1949 else -
1950 return QList<QByteArray>();
executed: return QList<QByteArray>();
Execution Count:1
1
1951} -
1952 -
1953/*! -
1954 Returns the list of parameter names for this method. -
1955 -
1956 \sa setParameterNames() -
1957*/ -
1958QList<QByteArray> QMetaMethodBuilder::parameterNames() const -
1959{ -
1960 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1961 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:1
1-18
1962 return d->parameterNames;
executed: return d->parameterNames;
Execution Count:18
18
1963 else -
1964 return QList<QByteArray>();
executed: return QList<QByteArray>();
Execution Count:1
1
1965} -
1966 -
1967/*! -
1968 Sets the list of parameter names for this method to \a value. -
1969 -
1970 \sa parameterNames() -
1971*/ -
1972void QMetaMethodBuilder::setParameterNames(const QList<QByteArray>& value) -
1973{ -
1974 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1975 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:91
no
Evaluation Count:0
0-91
1976 d->parameterNames = value;
executed: d->parameterNames = value;
Execution Count:91
91
1977}
executed: }
Execution Count:91
91
1978 -
1979/*! -
1980 Returns the tag associated with this method. -
1981 -
1982 \sa setTag() -
1983*/ -
1984QByteArray QMetaMethodBuilder::tag() const -
1985{ -
1986 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
1987 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:1
1-18
1988 return d->tag;
executed: return d->tag;
Execution Count:18
18
1989 else -
1990 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
1991} -
1992 -
1993/*! -
1994 Sets the tag associated with this method to \a value. -
1995 -
1996 \sa setTag() -
1997*/ -
1998void QMetaMethodBuilder::setTag(const QByteArray& value) -
1999{ -
2000 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2001 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:61
no
Evaluation Count:0
0-61
2002 d->tag = value;
executed: d->tag = value;
Execution Count:61
61
2003}
executed: }
Execution Count:61
61
2004 -
2005/*! -
2006 Returns the access specification of this method (private, protected, -
2007 or public). The default value is QMetaMethod::Public for methods, -
2008 slots, and constructors. The default value is QMetaMethod::Protected -
2009 for signals. -
2010 -
2011 \sa setAccess() -
2012*/ -
2013QMetaMethod::Access QMetaMethodBuilder::access() const -
2014{ -
2015 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2016 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:1
1-19
2017 return d->access();
executed: return d->access();
Execution Count:19
19
2018 else -
2019 return QMetaMethod::Public;
executed: return QMetaMethod::Public;
Execution Count:1
1
2020} -
2021 -
2022/*! -
2023 Sets the access specification of this method (private, protected, -
2024 or public) to \a value. If the method is a signal, this function -
2025 will be ignored. -
2026 -
2027 \sa access() -
2028*/ -
2029void QMetaMethodBuilder::setAccess(QMetaMethod::Access value) -
2030{ -
2031 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2032 if (d && d->methodType() != QMetaMethod::Signal)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:61
no
Evaluation Count:0
evaluated: d->methodType() != QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:10
0-61
2033 d->setAccess(value);
executed: d->setAccess(value);
Execution Count:51
51
2034}
executed: }
Execution Count:61
61
2035 -
2036/*! -
2037 Returns the additional attributes for this method. -
2038 -
2039 \sa setAttributes() -
2040*/ -
2041int QMetaMethodBuilder::attributes() const -
2042{ -
2043 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2044 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:1
1-18
2045 return (d->attributes >> 4);
executed: return (d->attributes >> 4);
Execution Count:18
18
2046 else -
2047 return 0;
executed: return 0;
Execution Count:1
1
2048} -
2049 -
2050/*! -
2051 Sets the additional attributes for this method to \a value. -
2052 -
2053 \sa attributes() -
2054*/ -
2055void QMetaMethodBuilder::setAttributes(int value) -
2056{ -
2057 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2058 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:61
no
Evaluation Count:0
0-61
2059 d->attributes = ((d->attributes & 0x0f) | (value << 4));
executed: d->attributes = ((d->attributes & 0x0f) | (value << 4));
Execution Count:61
61
2060}
executed: }
Execution Count:61
61
2061 -
2062/*! -
2063 Returns the revision of this method. -
2064 -
2065 \sa setRevision() -
2066*/ -
2067int QMetaMethodBuilder::revision() const -
2068{ -
2069 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2070 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:1
1-7
2071 return d->revision;
executed: return d->revision;
Execution Count:7
7
2072 return 0;
executed: return 0;
Execution Count:1
1
2073 -
2074} -
2075 -
2076/*! -
2077 Sets the \a revision of this method. -
2078 -
2079 \sa revision() -
2080*/ -
2081void QMetaMethodBuilder::setRevision(int revision) -
2082{ -
2083 QMetaMethodBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaMethodBuilderPrivate *d = d_func();
-
2084 if (d) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:55
no
Evaluation Count:0
0-55
2085 d->revision = revision;
executed (the execution status of this line is deduced): d->revision = revision;
-
2086 if (revision)
evaluated: revision
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:51
4-51
2087 d->attributes |= MethodRevisioned;
executed: d->attributes |= MethodRevisioned;
Execution Count:4
4
2088 else -
2089 d->attributes &= ~MethodRevisioned;
executed: d->attributes &= ~MethodRevisioned;
Execution Count:51
51
2090 } -
2091}
executed: }
Execution Count:55
55
2092 -
2093/*! -
2094 \class QMetaPropertyBuilder -
2095 \inmodule QtCore -
2096 \internal -
2097 \brief The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builder. -
2098*/ -
2099 -
2100QMetaPropertyBuilderPrivate *QMetaPropertyBuilder::d_func() const -
2101{ -
2102 if (_mobj && _index >= 0 && _index < _mobj->d->properties.size())
evaluated: _mobj
TRUEFALSE
yes
Evaluation Count:762
yes
Evaluation Count:17
partially evaluated: _index >= 0
TRUEFALSE
yes
Evaluation Count:762
no
Evaluation Count:0
partially evaluated: _index < _mobj->d->properties.size()
TRUEFALSE
yes
Evaluation Count:762
no
Evaluation Count:0
0-762
2103 return &(_mobj->d->properties[_index]);
executed: return &(_mobj->d->properties[_index]);
Execution Count:762
762
2104 else -
2105 return 0;
executed: return 0;
Execution Count:17
17
2106} -
2107 -
2108/*! -
2109 \fn QMetaPropertyBuilder::QMetaPropertyBuilder() -
2110 \internal -
2111*/ -
2112 -
2113/*! -
2114 \fn int QMetaPropertyBuilder::index() const -
2115 -
2116 Returns the index of this property within its QMetaObjectBuilder. -
2117*/ -
2118 -
2119/*! -
2120 Returns the name associated with this property. -
2121 -
2122 \sa type() -
2123*/ -
2124QByteArray QMetaPropertyBuilder::name() const -
2125{ -
2126 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2127 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:2
2-9
2128 return d->name;
executed: return d->name;
Execution Count:9
9
2129 else -
2130 return QByteArray();
executed: return QByteArray();
Execution Count:2
2
2131} -
2132 -
2133/*! -
2134 Returns the type associated with this property. -
2135 -
2136 \sa name() -
2137*/ -
2138QByteArray QMetaPropertyBuilder::type() const -
2139{ -
2140 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2141 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:1
1-7
2142 return d->type;
executed: return d->type;
Execution Count:7
7
2143 else -
2144 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
2145} -
2146 -
2147/*! -
2148 Returns true if this property has a notify signal; false otherwise. -
2149 -
2150 \sa notifySignal(), setNotifySignal(), removeNotifySignal() -
2151*/ -
2152bool QMetaPropertyBuilder::hasNotifySignal() const -
2153{ -
2154 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2155 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
1-10
2156 return d->flag(Notify);
executed: return d->flag(Notify);
Execution Count:10
10
2157 else -
2158 return false;
executed: return false;
Execution Count:1
1
2159} -
2160 -
2161/*! -
2162 Returns the notify signal associated with this property. -
2163 -
2164 \sa hasNotifySignal(), setNotifySignal(), removeNotifySignal() -
2165*/ -
2166QMetaMethodBuilder QMetaPropertyBuilder::notifySignal() const -
2167{ -
2168 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2169 if (d && d->notifySignal >= 0)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: d->notifySignal >= 0
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:3
0-7
2170 return QMetaMethodBuilder(_mobj, d->notifySignal);
executed: return QMetaMethodBuilder(_mobj, d->notifySignal);
Execution Count:4
4
2171 else -
2172 return QMetaMethodBuilder();
executed: return QMetaMethodBuilder();
Execution Count:3
3
2173} -
2174 -
2175/*! -
2176 Sets the notify signal associated with this property to \a value. -
2177 -
2178 \sa hasNotifySignal(), notifySignal(), removeNotifySignal() -
2179*/ -
2180void QMetaPropertyBuilder::setNotifySignal(const QMetaMethodBuilder& value) -
2181{ -
2182 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2183 if (d) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
2184 if (value._mobj) {
evaluated: value._mobj
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1
1-13
2185 d->notifySignal = value._index;
executed (the execution status of this line is deduced): d->notifySignal = value._index;
-
2186 d->setFlag(Notify, true);
executed (the execution status of this line is deduced): d->setFlag(Notify, true);
-
2187 } else {
executed: }
Execution Count:13
13
2188 d->notifySignal = -1;
executed (the execution status of this line is deduced): d->notifySignal = -1;
-
2189 d->setFlag(Notify, false);
executed (the execution status of this line is deduced): d->setFlag(Notify, false);
-
2190 }
executed: }
Execution Count:1
1
2191 } -
2192}
executed: }
Execution Count:14
14
2193 -
2194/*! -
2195 Removes the notify signal from this property. -
2196 -
2197 \sa hasNotifySignal(), notifySignal(), setNotifySignal() -
2198*/ -
2199void QMetaPropertyBuilder::removeNotifySignal() -
2200{ -
2201 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2202 if (d) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2203 d->notifySignal = -1;
executed (the execution status of this line is deduced): d->notifySignal = -1;
-
2204 d->setFlag(Notify, false);
executed (the execution status of this line is deduced): d->setFlag(Notify, false);
-
2205 }
executed: }
Execution Count:1
1
2206}
executed: }
Execution Count:1
1
2207 -
2208/*! -
2209 Returns true if this property is readable; otherwise returns false. -
2210 The default value is true. -
2211 -
2212 \sa setReadable(), isWritable() -
2213*/ -
2214bool QMetaPropertyBuilder::isReadable() const -
2215{ -
2216 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2217 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:1
1-29
2218 return d->flag(Readable);
executed: return d->flag(Readable);
Execution Count:29
29
2219 else -
2220 return false;
executed: return false;
Execution Count:1
1
2221} -
2222 -
2223/*! -
2224 Returns true if this property is writable; otherwise returns false. -
2225 The default value is true. -
2226 -
2227 \sa setWritable(), isReadable() -
2228*/ -
2229bool QMetaPropertyBuilder::isWritable() const -
2230{ -
2231 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2232 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:1
1-29
2233 return d->flag(Writable);
executed: return d->flag(Writable);
Execution Count:29
29
2234 else -
2235 return false;
executed: return false;
Execution Count:1
1
2236} -
2237 -
2238/*! -
2239 Returns true if this property can be reset to a default value; otherwise -
2240 returns false. The default value is false. -
2241 -
2242 \sa setResettable() -
2243*/ -
2244bool QMetaPropertyBuilder::isResettable() const -
2245{ -
2246 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2247 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2248 return d->flag(Resettable);
executed: return d->flag(Resettable);
Execution Count:30
30
2249 else -
2250 return false;
executed: return false;
Execution Count:1
1
2251} -
2252 -
2253/*! -
2254 Returns true if this property is designable; otherwise returns false. -
2255 This default value is false. -
2256 -
2257 \sa setDesignable(), isScriptable(), isStored() -
2258*/ -
2259bool QMetaPropertyBuilder::isDesignable() const -
2260{ -
2261 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2262 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2263 return d->flag(Designable);
executed: return d->flag(Designable);
Execution Count:30
30
2264 else -
2265 return false;
executed: return false;
Execution Count:1
1
2266} -
2267 -
2268/*! -
2269 Returns true if the property is scriptable; otherwise returns false. -
2270 This default value is true. -
2271 -
2272 \sa setScriptable(), isDesignable(), isStored() -
2273*/ -
2274bool QMetaPropertyBuilder::isScriptable() const -
2275{ -
2276 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2277 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2278 return d->flag(Scriptable);
executed: return d->flag(Scriptable);
Execution Count:30
30
2279 else -
2280 return false;
executed: return false;
Execution Count:1
1
2281} -
2282 -
2283/*! -
2284 Returns true if the property is stored; otherwise returns false. -
2285 This default value is false. -
2286 -
2287 \sa setStored(), isDesignable(), isScriptable() -
2288*/ -
2289bool QMetaPropertyBuilder::isStored() const -
2290{ -
2291 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2292 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2293 return d->flag(Stored);
executed: return d->flag(Stored);
Execution Count:30
30
2294 else -
2295 return false;
executed: return false;
Execution Count:1
1
2296} -
2297 -
2298/*! -
2299 Returns true if the property is editable; otherwise returns false. -
2300 This default value is false. -
2301 -
2302 \sa setEditable(), isDesignable(), isScriptable(), isStored() -
2303*/ -
2304bool QMetaPropertyBuilder::isEditable() const -
2305{ -
2306 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2307 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2308 return d->flag(Editable);
executed: return d->flag(Editable);
Execution Count:30
30
2309 else -
2310 return false;
executed: return false;
Execution Count:1
1
2311} -
2312 -
2313/*! -
2314 Returns true if this property is designated as the \c USER -
2315 property, i.e., the one that the user can edit or that is -
2316 significant in some other way. Otherwise it returns -
2317 false. This default value is false. -
2318 -
2319 \sa setUser(), isDesignable(), isScriptable() -
2320*/ -
2321bool QMetaPropertyBuilder::isUser() const -
2322{ -
2323 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2324 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2325 return d->flag(User);
executed: return d->flag(User);
Execution Count:30
30
2326 else -
2327 return false;
executed: return false;
Execution Count:1
1
2328} -
2329 -
2330/*! -
2331 Returns true if the property has a C++ setter function that -
2332 follows Qt's standard "name" / "setName" pattern. Designer and uic -
2333 query hasStdCppSet() in order to avoid expensive -
2334 QObject::setProperty() calls. All properties in Qt [should] follow -
2335 this pattern. The default value is false. -
2336 -
2337 \sa setStdCppSet() -
2338*/ -
2339bool QMetaPropertyBuilder::hasStdCppSet() const -
2340{ -
2341 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2342 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2343 return d->flag(StdCppSet);
executed: return d->flag(StdCppSet);
Execution Count:30
30
2344 else -
2345 return false;
executed: return false;
Execution Count:1
1
2346} -
2347 -
2348/*! -
2349 Returns true if the property is an enumerator or flag type; -
2350 otherwise returns false. This default value is false. -
2351 -
2352 \sa setEnumOrFlag() -
2353*/ -
2354bool QMetaPropertyBuilder::isEnumOrFlag() const -
2355{ -
2356 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2357 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2358 return d->flag(EnumOrFlag);
executed: return d->flag(EnumOrFlag);
Execution Count:30
30
2359 else -
2360 return false;
executed: return false;
Execution Count:1
1
2361} -
2362 -
2363/*! -
2364 Returns true if the property is constant; otherwise returns false. -
2365 The default value is false. -
2366*/ -
2367bool QMetaPropertyBuilder::isConstant() const -
2368{ -
2369 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2370 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2371 return d->flag(Constant);
executed: return d->flag(Constant);
Execution Count:30
30
2372 else -
2373 return false;
executed: return false;
Execution Count:1
1
2374} -
2375 -
2376/*! -
2377 Returns true if the property is final; otherwise returns false. -
2378 The default value is false. -
2379*/ -
2380bool QMetaPropertyBuilder::isFinal() const -
2381{ -
2382 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2383 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
2384 return d->flag(Final);
executed: return d->flag(Final);
Execution Count:30
30
2385 else -
2386 return false;
executed: return false;
Execution Count:1
1
2387} -
2388 -
2389/*! -
2390 Sets this property to readable if \a value is true. -
2391 -
2392 \sa isReadable(), setWritable() -
2393*/ -
2394void QMetaPropertyBuilder::setReadable(bool value) -
2395{ -
2396 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2397 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2398 d->setFlag(Readable, value);
executed: d->setFlag(Readable, value);
Execution Count:28
28
2399}
executed: }
Execution Count:28
28
2400 -
2401/*! -
2402 Sets this property to writable if \a value is true. -
2403 -
2404 \sa isWritable(), setReadable() -
2405*/ -
2406void QMetaPropertyBuilder::setWritable(bool value) -
2407{ -
2408 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2409 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2410 d->setFlag(Writable, value);
executed: d->setFlag(Writable, value);
Execution Count:28
28
2411}
executed: }
Execution Count:28
28
2412 -
2413/*! -
2414 Sets this property to resettable if \a value is true. -
2415 -
2416 \sa isResettable() -
2417*/ -
2418void QMetaPropertyBuilder::setResettable(bool value) -
2419{ -
2420 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2421 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2422 d->setFlag(Resettable, value);
executed: d->setFlag(Resettable, value);
Execution Count:28
28
2423}
executed: }
Execution Count:28
28
2424 -
2425/*! -
2426 Sets this property to designable if \a value is true. -
2427 -
2428 \sa isDesignable(), setScriptable(), setStored() -
2429*/ -
2430void QMetaPropertyBuilder::setDesignable(bool value) -
2431{ -
2432 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2433 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2434 d->setFlag(Designable, value);
executed: d->setFlag(Designable, value);
Execution Count:28
28
2435}
executed: }
Execution Count:28
28
2436 -
2437/*! -
2438 Sets this property to scriptable if \a value is true. -
2439 -
2440 \sa isScriptable(), setDesignable(), setStored() -
2441*/ -
2442void QMetaPropertyBuilder::setScriptable(bool value) -
2443{ -
2444 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2445 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2446 d->setFlag(Scriptable, value);
executed: d->setFlag(Scriptable, value);
Execution Count:28
28
2447}
executed: }
Execution Count:28
28
2448 -
2449/*! -
2450 Sets this property to storable if \a value is true. -
2451 -
2452 \sa isStored(), setDesignable(), setScriptable() -
2453*/ -
2454void QMetaPropertyBuilder::setStored(bool value) -
2455{ -
2456 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2457 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2458 d->setFlag(Stored, value);
executed: d->setFlag(Stored, value);
Execution Count:28
28
2459}
executed: }
Execution Count:28
28
2460 -
2461/*! -
2462 Sets this property to editable if \a value is true. -
2463 -
2464 \sa isEditable(), setDesignable(), setScriptable(), setStored() -
2465*/ -
2466void QMetaPropertyBuilder::setEditable(bool value) -
2467{ -
2468 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2469 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2470 d->setFlag(Editable, value);
executed: d->setFlag(Editable, value);
Execution Count:28
28
2471}
executed: }
Execution Count:28
28
2472 -
2473/*! -
2474 Sets the \c USER flag on this property to \a value. -
2475 -
2476 \sa isUser(), setDesignable(), setScriptable() -
2477*/ -
2478void QMetaPropertyBuilder::setUser(bool value) -
2479{ -
2480 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2481 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2482 d->setFlag(User, value);
executed: d->setFlag(User, value);
Execution Count:28
28
2483}
executed: }
Execution Count:28
28
2484 -
2485/*! -
2486 Sets the C++ setter flag on this property to \a value, which is -
2487 true if the property has a C++ setter function that follows Qt's -
2488 standard "name" / "setName" pattern. -
2489 -
2490 \sa hasStdCppSet() -
2491*/ -
2492void QMetaPropertyBuilder::setStdCppSet(bool value) -
2493{ -
2494 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2495 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2496 d->setFlag(StdCppSet, value);
executed: d->setFlag(StdCppSet, value);
Execution Count:28
28
2497}
executed: }
Execution Count:28
28
2498 -
2499/*! -
2500 Sets this property to be of an enumerator or flag type if -
2501 \a value is true. -
2502 -
2503 \sa isEnumOrFlag() -
2504*/ -
2505void QMetaPropertyBuilder::setEnumOrFlag(bool value) -
2506{ -
2507 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2508 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2509 d->setFlag(EnumOrFlag, value);
executed: d->setFlag(EnumOrFlag, value);
Execution Count:28
28
2510}
executed: }
Execution Count:28
28
2511 -
2512/*! -
2513 Sets the \c CONSTANT flag on this property to \a value. -
2514 -
2515 \sa isConstant() -
2516*/ -
2517void QMetaPropertyBuilder::setConstant(bool value) -
2518{ -
2519 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2520 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2521 d->setFlag(Constant, value);
executed: d->setFlag(Constant, value);
Execution Count:28
28
2522}
executed: }
Execution Count:28
28
2523 -
2524/*! -
2525 Sets the \c FINAL flag on this property to \a value. -
2526 -
2527 \sa isFinal() -
2528*/ -
2529void QMetaPropertyBuilder::setFinal(bool value) -
2530{ -
2531 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2532 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
2533 d->setFlag(Final, value);
executed: d->setFlag(Final, value);
Execution Count:28
28
2534}
executed: }
Execution Count:28
28
2535 -
2536/*! -
2537 Returns the revision of this property. -
2538 -
2539 \sa setRevision() -
2540*/ -
2541int QMetaPropertyBuilder::revision() const -
2542{ -
2543 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2544 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:1
1-5
2545 return d->revision;
executed: return d->revision;
Execution Count:5
5
2546 return 0;
executed: return 0;
Execution Count:1
1
2547 -
2548} -
2549 -
2550/*! -
2551 Sets the \a revision of this property. -
2552 -
2553 \sa revision() -
2554*/ -
2555void QMetaPropertyBuilder::setRevision(int revision) -
2556{ -
2557 QMetaPropertyBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaPropertyBuilderPrivate *d = d_func();
-
2558 if (d) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
2559 d->revision = revision;
executed (the execution status of this line is deduced): d->revision = revision;
-
2560 d->setFlag(Revisioned, revision != 0);
executed (the execution status of this line is deduced): d->setFlag(Revisioned, revision != 0);
-
2561 }
executed: }
Execution Count:15
15
2562}
executed: }
Execution Count:15
15
2563 -
2564 -
2565/*! -
2566 \class QMetaEnumBuilder -
2567 \inmodule QtCore -
2568 \internal -
2569 \brief The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder. -
2570*/ -
2571 -
2572QMetaEnumBuilderPrivate *QMetaEnumBuilder::d_func() const -
2573{ -
2574 if (_mobj && _index >= 0 && _index < _mobj->d->enumerators.size())
evaluated: _mobj
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:1
partially evaluated: _index >= 0
TRUEFALSE
yes
Evaluation Count:83
no
Evaluation Count:0
partially evaluated: _index < _mobj->d->enumerators.size()
TRUEFALSE
yes
Evaluation Count:83
no
Evaluation Count:0
0-83
2575 return &(_mobj->d->enumerators[_index]);
executed: return &(_mobj->d->enumerators[_index]);
Execution Count:83
83
2576 else -
2577 return 0;
executed: return 0;
Execution Count:1
1
2578} -
2579 -
2580/*! -
2581 \fn QMetaEnumBuilder::QMetaEnumBuilder() -
2582 \internal -
2583*/ -
2584 -
2585/*! -
2586 \fn int QMetaEnumBuilder::index() const -
2587 -
2588 Returns the index of this enumerator within its QMetaObjectBuilder. -
2589*/ -
2590 -
2591/*! -
2592 Returns the name of the enumerator (without the scope). -
2593*/ -
2594QByteArray QMetaEnumBuilder::name() const -
2595{ -
2596 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2597 if (d)
evaluated: d
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
1-10
2598 return d->name;
executed: return d->name;
Execution Count:10
10
2599 else -
2600 return QByteArray();
executed: return QByteArray();
Execution Count:1
1
2601} -
2602 -
2603/*! -
2604 Returns true if this enumerator is used as a flag; otherwise returns -
2605 false. -
2606 -
2607 \sa setIsFlag() -
2608*/ -
2609bool QMetaEnumBuilder::isFlag() const -
2610{ -
2611 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2612 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
2613 return d->isFlag;
executed: return d->isFlag;
Execution Count:9
9
2614 else -
2615 return false;
never executed: return false;
0
2616} -
2617 -
2618/*! -
2619 Sets this enumerator to be used as a flag if \a value is true. -
2620 -
2621 \sa isFlag() -
2622*/ -
2623void QMetaEnumBuilder::setIsFlag(bool value) -
2624{ -
2625 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2626 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
2627 d->isFlag = value;
executed: d->isFlag = value;
Execution Count:6
6
2628}
executed: }
Execution Count:6
6
2629 -
2630/*! -
2631 Returns the number of keys. -
2632 -
2633 \sa key(), addKey() -
2634*/ -
2635int QMetaEnumBuilder::keyCount() const -
2636{ -
2637 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2638 if (d)
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
2639 return d->keys.size();
executed: return d->keys.size();
Execution Count:9
9
2640 else -
2641 return 0;
never executed: return 0;
0
2642} -
2643 -
2644/*! -
2645 Returns the key with the given \a index, or an empty QByteArray -
2646 if no such key exists. -
2647 -
2648 \sa keyCount(), addKey(), value() -
2649*/ -
2650QByteArray QMetaEnumBuilder::key(int index) const -
2651{ -
2652 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2653 if (d && index >= 0 && index < d->keys.size())
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
evaluated: index < d->keys.size()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:6
0-20
2654 return d->keys[index];
executed: return d->keys[index];
Execution Count:14
14
2655 else -
2656 return QByteArray();
executed: return QByteArray();
Execution Count:6
6
2657} -
2658 -
2659/*! -
2660 Returns the value with the given \a index; or returns -1 if there -
2661 is no such value. -
2662 -
2663 \sa keyCount(), addKey(), key() -
2664*/ -
2665int QMetaEnumBuilder::value(int index) const -
2666{ -
2667 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2668 if (d && index >= 0 && index < d->keys.size())
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
evaluated: index < d->keys.size()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:1
0-15
2669 return d->values[index];
executed: return d->values[index];
Execution Count:14
14
2670 else -
2671 return -1;
executed: return -1;
Execution Count:1
1
2672} -
2673 -
2674/*! -
2675 Adds a new key called \a name to this enumerator, associated -
2676 with \a value. Returns the index of the new key. -
2677 -
2678 \sa keyCount(), key(), value(), removeKey() -
2679*/ -
2680int QMetaEnumBuilder::addKey(const QByteArray& name, int value) -
2681{ -
2682 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2683 if (d) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
2684 int index = d->keys.size();
executed (the execution status of this line is deduced): int index = d->keys.size();
-
2685 d->keys += name;
executed (the execution status of this line is deduced): d->keys += name;
-
2686 d->values += value;
executed (the execution status of this line is deduced): d->values += value;
-
2687 return index;
executed: return index;
Execution Count:13
13
2688 } else { -
2689 return -1;
never executed: return -1;
0
2690 } -
2691} -
2692 -
2693/*! -
2694 Removes the key at \a index from this enumerator. -
2695 -
2696 \sa addKey() -
2697*/ -
2698void QMetaEnumBuilder::removeKey(int index) -
2699{ -
2700 QMetaEnumBuilderPrivate *d = d_func();
executed (the execution status of this line is deduced): QMetaEnumBuilderPrivate *d = d_func();
-
2701 if (d && index >= 0 && index < d->keys.size()) {
partially evaluated: d
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index >= 0
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: index < d->keys.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2702 d->keys.removeAt(index);
executed (the execution status of this line is deduced): d->keys.removeAt(index);
-
2703 d->values.removeAt(index);
executed (the execution status of this line is deduced): d->values.removeAt(index);
-
2704 }
executed: }
Execution Count:1
1
2705}
executed: }
Execution Count:1
1
2706 -
2707QT_END_NAMESPACE -
2708 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial