| 239 | } |
| 240 | |
| 241 | SourceLocation QmlObjectDataProvider::declarationLocation(const QObject *obj) const |
| 242 | { |
| 243 | Q_ASSERT(obj); |
| 244 | |
| 245 | // C++ QML type |
| 246 | auto qmlType = QQmlMetaType::qmlType(obj->metaObject()); |
| 247 | if (QmlType::isValid(qmlType)) |
| 248 | return SourceLocation(QmlType::callable(qmlType)->sourceUrl()); |
| 249 | |
| 250 | // QML-defined type |
| 251 | auto data = QQmlData::get(obj); |
| 252 | if (!data || !data->compilationUnit) |
| 253 | return SourceLocation(); |
| 254 | |
| 255 | qmlType = QQmlMetaType::qmlType(data->compilationUnit->url()); |
| 256 | if (QmlType::isValid(qmlType)) |
| 257 | return SourceLocation(QmlType::callable(qmlType)->sourceUrl()); |
| 258 | return SourceLocation(); |
| 259 | } |
| 260 | |
| 261 | QmlSupport::QmlSupport(Probe *probe, QObject *parent) |
| 262 | : QObject(parent) |
nothing calls this directly
no test coverage detected