MCPcopy Create free account
hub / github.com/KDAB/GammaRay / iconIdForObject

Function iconIdForObject

core/util.cpp:179–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static int iconIdForObject(const QMetaObject *mo, const QObject *obj)
180{
181 static const IconDatabase iconDataBase = readIconData();
182
183 auto it = iconDataBase.constFind(QLatin1String(mo->className()));
184 if (it != iconDataBase.end()) {
185 for (const auto &propertyIcon : std::as_const(it->propertyIcons)) {
186 bool allMatch = true;
187 Q_ASSERT(!propertyIcon.second.isEmpty());
188 for (const IconCacheEntry::PropertyPair &keyValue : std::as_const(propertyIcon.second)) {
189 if (stringifyProperty(obj, keyValue.first) != keyValue.second) {
190 allMatch = false;
191 break;
192 }
193 }
194 if (allMatch)
195 return propertyIcon.first;
196 }
197 return it->defaultIcon;
198 }
199
200 if (mo->superClass())
201 return iconIdForObject(mo->superClass(), obj);
202
203 return -1;
204}
205}
206
207int Util::iconIdForObject(const QObject *object)

Callers 5

iconIdForObjectMethod · 0.85
dataForObjectMethod · 0.85
iconForObjectMethod · 0.85
dataMethod · 0.85
ItemMethod · 0.85

Calls 6

readIconDataFunction · 0.85
stringifyPropertyFunction · 0.85
endMethod · 0.80
superClassMethod · 0.80
classNameMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected