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// Qt-Security score:significant reason:default
4
8
9#include <private/qqmlmetatype_p.h>
10
12
13bool QQuickDesignerSupportMetaInfo::isSubclassOf(QObject *object, const QByteArray &superTypeName)
14{
15 if (object == nullptr)
16 return false;
17
18 const QMetaObject *metaObject = object->metaObject();
19
20 while (metaObject) {
21 QQmlType qmlType = QQmlMetaType::qmlType(metaObject);
22 if (qmlType.qmlTypeName() == QLatin1String(superTypeName)) // ignore version numbers
23 return true;
24
25 if (metaObject->className() == superTypeName)
26 return true;
27
28 metaObject = metaObject->superClass();
29 }
30
31 return false;
32}
33
34void QQuickDesignerSupportMetaInfo::registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const QQuickDesignerSupport::PropertyName &))
35{
36 QQmlDesignerMetaObject::registerNotifyPropertyChangeCallBack(callback);
37}
38
39void QQuickDesignerSupportMetaInfo::registerMockupObject(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
40{
41 qmlRegisterCustomType<QQuickDesignerCustomParserObject>(uri, versionMajor, versionMinor, qmlName, new QQuickDesignerCustomParser);
42}
43
44QT_END_NAMESPACE
Combined button and popup list for selecting options.