Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickdesignersupportmetainfo.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7
8#include <private/qqmlmetatype_p.h>
9
11
12bool QQuickDesignerSupportMetaInfo::isSubclassOf(QObject *object, const QByteArray &superTypeName)
13{
14 if (object == nullptr)
15 return false;
16
17 const QMetaObject *metaObject = object->metaObject();
18
19 while (metaObject) {
20 QQmlType qmlType = QQmlMetaType::qmlType(metaObject);
21 if (qmlType.qmlTypeName() == QLatin1String(superTypeName)) // ignore version numbers
22 return true;
23
24 if (metaObject->className() == superTypeName)
25 return true;
26
27 metaObject = metaObject->superClass();
28 }
29
30 return false;
31}
32
33void QQuickDesignerSupportMetaInfo::registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const QQuickDesignerSupport::PropertyName &))
34{
35 QQmlDesignerMetaObject::registerNotifyPropertyChangeCallBack(callback);
36}
37
38void QQuickDesignerSupportMetaInfo::registerMockupObject(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
39{
40 qmlRegisterCustomType<QQuickDesignerCustomParserObject>(uri, versionMajor, versionMinor, qmlName, new QQuickDesignerCustomParser);
41}
42
43QT_END_NAMESPACE