OpenCoverage

qquickdesignersupportproperties.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/designer/qquickdesignersupportproperties.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static void addToPropertyNameListIfNotBlackListed(QQuickDesignerSupport::PropertyNameList *propertyNameList,-
6 const QQuickDesignerSupport::PropertyName &propertyName)-
7{-
8 if (!QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName)
!QQuickDesigne...(propertyName)Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
)
8-240
9 propertyNameList->append(propertyName);
executed 240 times by 1 test: propertyNameList->append(propertyName);
Executed by:
  • tst_qquickdesignersupport
240
10}
executed 248 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
248
11-
12void QQuickDesignerSupportProperties::createNewDynamicProperty(QObject *object, QQmlEngine *engine, const QString &name)-
13{-
14 QQmlDesignerMetaObject::getNodeInstanceMetaObject(object, engine)->createNewDynamicProperty(name);-
15}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
2
16-
17void QQuickDesignerSupportProperties::registerNodeInstanceMetaObject(QObject *object, QQmlEngine *engine)-
18{-
19-
20 QQmlDesignerMetaObject::getNodeInstanceMetaObject(object, engine);-
21}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
4
22-
23bool QQuickDesignerSupportProperties::hasFullImplementedListInterface(const QQmlListReference &list)-
24{-
25 return
never executed: return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
never executed: return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear();
0
26}-
27-
28void QQuickDesignerSupportProperties::registerCustomData(QObject *object)-
29{-
30 QQuickDesignerCustomObjectData::registerData(object);-
31}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
4
32-
33QVariant QQuickDesignerSupportProperties::getResetValue(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName)-
34{-
35 return
executed 8 times by 1 test: return QQuickDesignerCustomObjectData::getResetValue(object, propertyName);
Executed by:
  • tst_qquickdesignersupport
QQuickDesignerCustomObjectData::getResetValue(object, propertyName);
executed 8 times by 1 test: return QQuickDesignerCustomObjectData::getResetValue(object, propertyName);
Executed by:
  • tst_qquickdesignersupport
8
36}-
37-
38void QQuickDesignerSupportProperties::doResetProperty(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName)-
39{-
40 QQuickDesignerCustomObjectData::doResetProperty(object, context, propertyName);-
41}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
8
42-
43bool QQuickDesignerSupportProperties::hasValidResetBinding(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName)-
44{-
45 return
executed 2 times by 1 test: return QQuickDesignerCustomObjectData::hasValidResetBinding(object, propertyName);
Executed by:
  • tst_qquickdesignersupport
QQuickDesignerCustomObjectData::hasValidResetBinding(object, propertyName);
executed 2 times by 1 test: return QQuickDesignerCustomObjectData::hasValidResetBinding(object, propertyName);
Executed by:
  • tst_qquickdesignersupport
2
46}-
47-
48bool QQuickDesignerSupportProperties::hasBindingForProperty(QObject *object,-
49 QQmlContext *context,-
50 const QQuickDesignerSupport::PropertyName &propertyName,-
51 bool *hasChanged)-
52{-
53 return
executed 12 times by 1 test: return QQuickDesignerCustomObjectData::hasBindingForProperty(object, context, propertyName, hasChanged);
Executed by:
  • tst_qquickdesignersupport
QQuickDesignerCustomObjectData::hasBindingForProperty(object, context, propertyName, hasChanged);
executed 12 times by 1 test: return QQuickDesignerCustomObjectData::hasBindingForProperty(object, context, propertyName, hasChanged);
Executed by:
  • tst_qquickdesignersupport
12
54}-
55-
56void QQuickDesignerSupportProperties::setPropertyBinding(QObject *object,-
57 QQmlContext *context,-
58 const QQuickDesignerSupport::PropertyName &propertyName,-
59 const QString &expression)-
60{-
61 QQuickDesignerCustomObjectData::setPropertyBinding(object, context, propertyName, expression);-
62}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
4
63-
64void QQuickDesignerSupportProperties::keepBindingFromGettingDeleted(QObject *object,-
65 QQmlContext *context,-
66 const QQuickDesignerSupport::PropertyName &propertyName)-
67{-
68 QQuickDesignerCustomObjectData::keepBindingFromGettingDeleted(object, context, propertyName);-
69}
never executed: end of block
0
70-
71bool QQuickDesignerSupportProperties::isPropertyQObject(const QMetaProperty &metaProperty)-
72{-
73 return
executed 4 times by 1 test: return QQmlMetaType::isQObject(metaProperty.userType());
Executed by:
  • tst_qquickdesignersupport
QQmlMetaType::isQObject(metaProperty.userType());
executed 4 times by 1 test: return QQmlMetaType::isQObject(metaProperty.userType());
Executed by:
  • tst_qquickdesignersupport
4
74}-
75-
76-
77QObject *QQuickDesignerSupportProperties::readQObjectProperty(const QMetaProperty &metaProperty, QObject *object)-
78{-
79 return
executed 2 times by 1 test: return QQmlMetaType::toQObject(metaProperty.read(object));
Executed by:
  • tst_qquickdesignersupport
QQmlMetaType::toQObject(metaProperty.read(object));
executed 2 times by 1 test: return QQmlMetaType::toQObject(metaProperty.read(object));
Executed by:
  • tst_qquickdesignersupport
2
80}-
81-
82void QQuickDesignerSupportProperties::getPropertyCache(QObject *object, QQmlEngine *engine)-
83{-
84 QQmlEnginePrivate::get(engine)->cache(object->metaObject());-
85}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
2
86-
87QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::propertyNameListForWritableProperties(QObject *object,-
88 const QQuickDesignerSupport::PropertyName &baseName,-
89 QObjectList *inspectedObjects)-
90{-
91 QQuickDesignerSupport::PropertyNameList propertyNameList;-
92-
93 QObjectList localObjectList;-
94-
95 if (inspectedObjects == nullptr
inspectedObjects == nullptrDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
)
4-24
96 inspectedObjects = &localObjectList;
executed 4 times by 1 test: inspectedObjects = &localObjectList;
Executed by:
  • tst_qquickdesignersupport
4
97-
98-
99 if (inspectedObjects->contains(object)
inspectedObjec...ntains(object)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
)
4-24
100 return
executed 4 times by 1 test: return propertyNameList;
Executed by:
  • tst_qquickdesignersupport
propertyNameList;
executed 4 times by 1 test: return propertyNameList;
Executed by:
  • tst_qquickdesignersupport
4
101-
102 inspectedObjects->append(object);-
103-
104 const QMetaObject *metaObject = object->metaObject();-
105 for (int index = 0; index < metaObject->propertyCount()
index < metaOb...ropertyCount()Description
TRUEevaluated 340 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
; ++index) {
24-340
106 QMetaProperty metaProperty = metaObject->property(index);-
107 QQmlProperty declarativeProperty(object, QString::fromUtf8(metaProperty.name()));-
108 if (declarativeProperty.isValid()
declarativeProperty.isValid()Description
TRUEevaluated 340 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEnever evaluated
&& !declarativeProperty.isWritable()
!declarativePr...y.isWritable()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 276 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
&& declarativeProperty.propertyTypeCategory() == QQmlProperty::Object
declarativePro...operty::ObjectDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
) {
0-340
109 if (declarativeProperty.name() != QLatin1String("parent")
declarativePro...ring("parent")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEnever evaluated
) {
0-8
110 QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());-
111 if (childObject
childObjectDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEnever evaluated
)
0-8
112 propertyNameList.append(propertyNameListForWritableProperties(childObject,
executed 8 times by 1 test: propertyNameList.append(propertyNameListForWritableProperties(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
Executed by:
  • tst_qquickdesignersupport
8
113 baseName + QQuickDesignerSupport::PropertyName(metaProperty.name())
executed 8 times by 1 test: propertyNameList.append(propertyNameListForWritableProperties(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
Executed by:
  • tst_qquickdesignersupport
8
114 + '.', inspectedObjects));
executed 8 times by 1 test: propertyNameList.append(propertyNameListForWritableProperties(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
Executed by:
  • tst_qquickdesignersupport
8
115 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
8
116 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
else if (QQmlValueTypeFactory::valueType(metaProperty.userType())
QQmlValueTypeF...ty.userType())Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 316 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
) {
8-316
117 QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());-
118 valueType->setValue(metaProperty.read(object));-
119 propertyNameList.append(propertyNameListForWritableProperties(valueType,-
120 baseName + QQuickDesignerSupport::PropertyName(metaProperty.name())-
121 + '.', inspectedObjects));-
122 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
16
123-
124 if (metaProperty.isReadable()
metaProperty.isReadable()Description
TRUEevaluated 340 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEnever evaluated
&& metaProperty.isWritable()
metaProperty.isWritable()Description
TRUEevaluated 248 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
) {
0-340
125 addToPropertyNameListIfNotBlackListed(&propertyNameList,-
126 baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()));-
127 }
executed 248 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
248
128 }
executed 340 times by 1 test: end of block
Executed by:
  • tst_qquickdesignersupport
340
129-
130 return
executed 24 times by 1 test: return propertyNameList;
Executed by:
  • tst_qquickdesignersupport
propertyNameList;
executed 24 times by 1 test: return propertyNameList;
Executed by:
  • tst_qquickdesignersupport
24
131}-
132-
133bool QQuickDesignerSupportProperties::isPropertyBlackListed(const QQuickDesignerSupport::PropertyName &propertyName)-
134{-
135 if (propertyName.contains(".")
propertyName.contains(".")Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
&& propertyName.contains("__")
propertyName.contains("__")Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
)
0-156
136 return
never executed: return true;
true;
never executed: return true;
0
137-
138 if (propertyName.count(".") > 1
propertyName.count(".") > 1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
FALSEevaluated 252 times by 1 test
Evaluated by:
  • tst_qquickdesignersupport
)
8-252
139 return
executed 8 times by 1 test: return true;
Executed by:
  • tst_qquickdesignersupport
true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_qquickdesignersupport
8
140-
141 return
executed 252 times by 1 test: return false;
Executed by:
  • tst_qquickdesignersupport
false;
executed 252 times by 1 test: return false;
Executed by:
  • tst_qquickdesignersupport
252
142}-
143-
144QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::allPropertyNames(QObject *object,-
145 const QQuickDesignerSupport::PropertyName &baseName,-
146 QObjectList *inspectedObjects)-
147{-
148 QQuickDesignerSupport::PropertyNameList propertyNameList;-
149-
150 QObjectList localObjectList;-
151-
152 if (inspectedObjects == nullptr
inspectedObjects == nullptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
153 inspectedObjects = &localObjectList;
never executed: inspectedObjects = &localObjectList;
0
154-
155-
156 if (inspectedObjects->contains(object)
inspectedObjec...ntains(object)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
157 return
never executed: return propertyNameList;
propertyNameList;
never executed: return propertyNameList;
0
158-
159 inspectedObjects->append(object);-
160-
161-
162 const QMetaObject *metaObject = object->metaObject();-
163-
164 QStringList deferredPropertyNames;-
165 const int namesIndex = metaObject->indexOfClassInfo("DeferredPropertyNames");-
166 if (namesIndex != -1
namesIndex != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
167 QMetaClassInfo classInfo = metaObject->classInfo(namesIndex);-
168 deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));-
169 }
never executed: end of block
0
170-
171 for (int index = 0; index < metaObject->propertyCount()
index < metaOb...ropertyCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++index) {
0
172 QMetaProperty metaProperty = metaObject->property(index);-
173 QQmlProperty declarativeProperty(object, QString::fromUtf8(metaProperty.name()));-
174 if (declarativeProperty.isValid()
declarativeProperty.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& declarativeProperty.propertyTypeCategory() == QQmlProperty::Object
declarativePro...operty::ObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
175 if (declarativeProperty.name() != QLatin1String("parent")
declarativePro...ring("parent")Description
TRUEnever evaluated
FALSEnever evaluated
0
176 && !deferredPropertyNames.contains(declarativeProperty.name())
!deferredPrope...operty.name())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
177 QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());-
178 if (childObject
childObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
179 propertyNameList.append(allPropertyNames(childObject,
never executed: propertyNameList.append(allPropertyNames(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
0
180 baseName
never executed: propertyNameList.append(allPropertyNames(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
0
181 + QQuickDesignerSupport::PropertyName(metaProperty.name())
never executed: propertyNameList.append(allPropertyNames(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
0
182 + '.', inspectedObjects));
never executed: propertyNameList.append(allPropertyNames(childObject, baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()) + '.', inspectedObjects));
0
183 }
never executed: end of block
0
184 }
never executed: end of block
else if (QQmlValueTypeFactory::valueType(metaProperty.userType())
QQmlValueTypeF...ty.userType())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
185 QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());-
186 valueType->setValue(metaProperty.read(object));-
187 propertyNameList.append(baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()));-
188 propertyNameList.append(allPropertyNames(valueType,-
189 baseName-
190 + QQuickDesignerSupport::PropertyName(metaProperty.name())-
191 + '.', inspectedObjects));-
192 }
never executed: end of block
else {
0
193 addToPropertyNameListIfNotBlackListed(&propertyNameList,-
194 baseName + QQuickDesignerSupport::PropertyName(metaProperty.name()));-
195 }
never executed: end of block
0
196 }-
197-
198 return
never executed: return propertyNameList;
propertyNameList;
never executed: return propertyNameList;
0
199}-
200-
201-
202-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0