Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlproxymetaobject.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | QQmlProxyMetaObject::QQmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList) | - | ||||||
5 | : metaObjects(mList), proxies(nullptr), parent(nullptr), object(obj) | - | ||||||
6 | { | - | ||||||
7 | *static_cast<QMetaObject *>(this) = *metaObjects->constFirst().metaObject; | - | ||||||
8 | - | |||||||
9 | QObjectPrivate *op = QObjectPrivate::get(obj); | - | ||||||
10 | if (op->metaObject
| 0-16 | ||||||
11 | parent = static_cast<QAbstractDynamicMetaObject*>(op->metaObject); never executed: parent = static_cast<QAbstractDynamicMetaObject*>(op->metaObject); | 0 | ||||||
12 | - | |||||||
13 | op->metaObject = this; | - | ||||||
14 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
15 | - | |||||||
16 | QQmlProxyMetaObject::~QQmlProxyMetaObject() | - | ||||||
17 | { | - | ||||||
18 | if (parent
| 0-16 | ||||||
19 | delete parent; never executed: delete parent; | 0 | ||||||
20 | parent = nullptr; | - | ||||||
21 | - | |||||||
22 | if (proxies
| 4-12 | ||||||
23 | delete [] proxies; executed 12 times by 1 test: delete [] proxies; Executed by:
| 12 | ||||||
24 | proxies = nullptr; | - | ||||||
25 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
26 | - | |||||||
27 | int QQmlProxyMetaObject::metaCall(QObject *o, QMetaObject::Call c, int id, void **a) | - | ||||||
28 | { | - | ||||||
29 | ((object == o) ? static_cast<void>(0) : qt_assert("object == o", __FILE__, 70)); | - | ||||||
30 | - | |||||||
31 | if ((c == QMetaObject::ReadProperty
| 22-44 | ||||||
32 | c == QMetaObject::WriteProperty
| 20-24 | ||||||
33 | id >= metaObjects->constLast().propertyOffset
| 2-44 | ||||||
34 | - | |||||||
35 | for (int ii = 0; ii < metaObjects->count()
| 0-60 | ||||||
36 | const ProxyData &data = metaObjects->at(ii); | - | ||||||
37 | if (id >= data.propertyOffset
| 16-44 | ||||||
38 | if (!proxies
| 12-32 | ||||||
39 | proxies = new QObject*[metaObjects->count()]; | - | ||||||
40 | ::memset(proxies, 0, | - | ||||||
41 | sizeof(QObject *) * metaObjects->count()); | - | ||||||
42 | } executed 12 times by 1 test: end of block Executed by:
| 12 | ||||||
43 | - | |||||||
44 | if (!proxies[ii]
| 16-28 | ||||||
45 | QObject *proxy = data.createFunc(object); | - | ||||||
46 | const QMetaObject *metaObject = proxy->metaObject(); | - | ||||||
47 | proxies[ii] = proxy; | - | ||||||
48 | - | |||||||
49 | int localOffset = data.metaObject->methodOffset(); | - | ||||||
50 | int methodOffset = metaObject->methodOffset(); | - | ||||||
51 | int methods = metaObject->methodCount() - methodOffset; | - | ||||||
52 | - | |||||||
53 | - | |||||||
54 | for (int jj = 0; jj < methods
| 16 | ||||||
55 | QMetaMethod method = | - | ||||||
56 | metaObject->method(jj + methodOffset); | - | ||||||
57 | if (method.methodType() == QMetaMethod::Signal
| 0-16 | ||||||
58 | QQmlPropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj); executed 16 times by 1 test: QQmlPropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj); Executed by:
| 16 | ||||||
59 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
60 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
61 | - | |||||||
62 | int proxyOffset = proxies[ii]->metaObject()->propertyOffset(); | - | ||||||
63 | int proxyId = id - data.propertyOffset + proxyOffset; | - | ||||||
64 | - | |||||||
65 | return executed 44 times by 1 test: proxies[ii]->qt_metacall(c, proxyId, a);return proxies[ii]->qt_metacall(c, proxyId, a); Executed by:
executed 44 times by 1 test: return proxies[ii]->qt_metacall(c, proxyId, a); Executed by:
| 44 | ||||||
66 | } | - | ||||||
67 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||
68 | } never executed: else if (c == QMetaObject::InvokeMetaMethodend of block
| 0-20 | ||||||
69 | id >= metaObjects->constLast().methodOffset
| 0-20 | ||||||
70 | QMetaMethod m = object->metaObject()->method(id); | - | ||||||
71 | if (m.methodType() == QMetaMethod::Signal
| 0-20 | ||||||
72 | QMetaObject::activate(object, id, a); | - | ||||||
73 | return executed 20 times by 1 test: -1;return -1; Executed by:
executed 20 times by 1 test: return -1; Executed by:
| 20 | ||||||
74 | } | - | ||||||
75 | } never executed: end of block | 0 | ||||||
76 | - | |||||||
77 | if (parent
| 0-2 | ||||||
78 | return never executed: parent->metaCall(o, c, id, a);return parent->metaCall(o, c, id, a); never executed: return parent->metaCall(o, c, id, a); | 0 | ||||||
79 | else | - | ||||||
80 | return executed 2 times by 1 test: object->qt_metacall(c, id, a);return object->qt_metacall(c, id, a); Executed by:
executed 2 times by 1 test: return object->qt_metacall(c, id, a); Executed by:
| 2 | ||||||
81 | } | - | ||||||
82 | - | |||||||
83 | - | |||||||
Switch to Source code | Preprocessed file |