Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmltype.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 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
4#include "qqmltype_p_p.h"
5
6#include <QtQml/qjsvalue.h>
7#include <QtQml/qqmlengine.h>
8#include <QtQml/qqmlcontext.h>
9#include <QtQml/qqmlcomponent.h>
10
11#include <private/qqmlcustomparser_p.h>
12#include <private/qqmldata_p.h>
13#include <private/qqmlmetatypedata_p.h>
14#include <private/qqmlpropertycache_p.h>
15#include <private/qqmltypedata_p.h>
16
18
20 : regType(type)
21{
22 switch (type) {
26 extraData.cppTypeData->newFunc = nullptr;
29 extraData.cppTypeData->extFunc = nullptr;
39 break;
46 break;
49 break;
52 break;
55 break;
58 break;
59 default: qFatal("QQmlTypePrivate Internal Error.");
60 }
61}
62
63QQmlTypePrivate::~QQmlTypePrivate()
64{
65 delete enums.fetchAndStoreAcquire(nullptr);
66 delete proxyMetaObjects.fetchAndStoreAcquire(nullptr);
67
68 if (const QtPrivate::QMetaTypeInterface *iface = typeId.iface()) {
69 if (iface->metaObjectFn == &dynamicQmlMetaObject)
71 }
72
73 switch (regType) {
75 delete extraData.cppTypeData->customParser;
76 delete extraData.cppTypeData;
77 break;
80 extraData.singletonTypeData->singletonInstanceInfo.reset();
81 delete extraData.singletonTypeData;
82 break;
84 extraData.compositeTypeData.~QUrl();
85 break;
87 extraData.inlineComponentTypeData.~QUrl();
88 break;
90 extraData.sequentialContainerTypeData.~QMetaSequence();
91 break;
92 default: //Also InterfaceType, because it has no extra data
93 break;
94 }
95}
96
97QQmlType::QQmlType() = default;
98QQmlType::QQmlType(const QQmlType &) = default;
99QQmlType::QQmlType(QQmlType &&) = default;
103QQmlType::~QQmlType() = default;
104
106{
107 if (!d)
108 return QHashedString();
109 return d->module;
110}
111
113{
114 if (!d)
115 return QTypeRevision();
116 return d->version;
117}
118
120{
121 if (!d)
122 return false;
123
125 return true;
126
128 return false;
129
131}
132
134{
135 if (!d || module != d->module)
136 return false;
137
139}
140
142{
144 if (!engine)
145 return QQmlType();
146 QQmlRefPointer<QQmlTypeData> td(engine->typeLoader.getType(sourceUrl()));
147 if (td.isNull() || !td->isComplete())
148 return QQmlType();
149 QV4::CompiledData::CompilationUnit *compilationUnit = td->compilationUnit();
150 const QMetaObject *mo = compilationUnit->rootPropertyCache()->firstCppMetaObject();
152}
153
156{
157 // similar logic to resolveCompositeBaseType
159 if (!engine)
160 return nullptr;
161 QQmlRefPointer<QQmlTypeData> td(engine->typeLoader.getType(sourceUrl()));
162 if (td.isNull() || !td->isComplete())
163 return nullptr;
164 QV4::CompiledData::CompilationUnit *compilationUnit = td->compilationUnit();
165 return compilationUnit->rootPropertyCache();
166}
167
168static bool isPropertyRevisioned(const QMetaObject *mo, int index)
169{
170 return mo->property(index).revision();
171}
172
174{
175 if (const ProxyMetaObjects *result = proxyMetaObjects.loadRelaxed())
176 return result;
177
178 ProxyMetaObjects *proxies = new ProxyMetaObjects;
179 auto finalize = [this, proxies]() -> const ProxyMetaObjects *{
180 const ProxyMetaObjects *concurrentModification;
181 if (proxyMetaObjects.testAndSetOrdered(nullptr, proxies, concurrentModification))
182 return proxies;
183
184 delete proxies;
185 return concurrentModification;
186 };
187
189 if (!mo) {
190 // version 0 singleton type without metaobject information
191 return finalize();
192 }
193
194 QList<QQmlProxyMetaObject::ProxyData> metaObjects;
195
196 auto setupExtendedMetaObject = [&](const QMetaObject *extMetaObject,
197 QObject *(*extFunc)(QObject *)) {
198 if (!extMetaObject)
199 return;
200
201 // XXX - very inefficient
202 QMetaObjectBuilder builder;
203 QQmlMetaType::clone(builder, extMetaObject, extMetaObject, extMetaObject,
205 QMetaObject *mmo = builder.toMetaObject();
206 mmo->d.superdata = mo;
207 QQmlProxyMetaObject::ProxyData data = { mmo, extFunc, 0, 0 };
208 metaObjects << data;
210 };
211
214 else if (regType == QQmlType::CppType)
216
217 metaObjects.append(QQmlMetaType::proxyData(
218 mo, baseMetaObject, metaObjects.isEmpty() ? nullptr
219 : metaObjects.constLast().metaObject));
220
221 for (int ii = 0; ii < metaObjects.size(); ++ii) {
222 metaObjects[ii].propertyOffset =
223 metaObjects.at(ii).metaObject->propertyOffset();
224 metaObjects[ii].methodOffset =
225 metaObjects.at(ii).metaObject->methodOffset();
226 }
227
228 bool containsRevisionedAttributes = false;
229
230 // Check for revisioned details
231 {
232 const QMetaObject *mo = nullptr;
233 if (metaObjects.isEmpty())
235 else
236 mo = metaObjects.constFirst().metaObject;
237
238 for (int ii = 0; !containsRevisionedAttributes && ii < mo->propertyCount(); ++ii) {
239 if (isPropertyRevisioned(mo, ii))
240 containsRevisionedAttributes = true;
241 }
242
243 for (int ii = 0; !containsRevisionedAttributes && ii < mo->methodCount(); ++ii) {
244 if (mo->method(ii).revision() != 0)
245 containsRevisionedAttributes = true;
246 }
247 }
248
249 proxies->data = std::move(metaObjects);
250 proxies->containsRevisionedAttributes = containsRevisionedAttributes;
251
252 return finalize();
253}
254
255const QQmlTypePrivate::Enums *QQmlTypePrivate::initEnums(QQmlEnginePrivate *engine) const
256{
257 if (const Enums *result = enums.loadRelaxed())
258 return result;
259
261 if (isComposite()) {
263 if (!cache)
264 return nullptr; // Composite type not ready, yet.
265 }
266
267 Enums *newEnums = new Enums;
268
269 // beware: It could be a singleton type without metaobject
270
271 if (cache)
272 insertEnumsFromPropertyCache(newEnums, cache);
273
274 if (baseMetaObject) {
275 // init() can add to the metaObjects list. Therefore, check proxies->data only below
276 const ProxyMetaObjects *proxies = init();
277 insertEnums(
278 newEnums,
279 proxies->data.isEmpty() ? baseMetaObject : proxies->data.constFirst().metaObject);
280 }
281
282 const Enums *concurrentModification;
283 if (enums.testAndSetOrdered(nullptr, newEnums, concurrentModification))
284 return newEnums;
285
286 delete newEnums;
287 return concurrentModification;
288}
289
290void QQmlTypePrivate::insertEnums(Enums *enums, const QMetaObject *metaObject) const
291{
292 // Add any enum values defined by 'related' classes
293 if (regType != QQmlType::CppType || extraData.cppTypeData->registerEnumsFromRelatedTypes) {
294 if (const auto *related = metaObject->d.relatedMetaObjects) {
295 while (const QMetaObject *relatedMetaObject = *related) {
296 insertEnums(enums, relatedMetaObject);
297 ++related;
298 }
299 }
300 }
301
302 QSet<QString> localEnums;
303 const QMetaObject *localMetaObject = nullptr;
304
305 // ### TODO (QTBUG-123294): track this at instance creation time
306 auto shouldSingletonAlsoRegisterUnscoped = [&](){
308 if (!baseMetaObject)
309 return true;
310 int idx = baseMetaObject->indexOfClassInfo("RegisterEnumClassesUnscoped");
311 if (idx == -1)
312 return true;
313 if (qstrcmp(baseMetaObject->classInfo(idx).value(), "false") == 0)
314 return false;
315 return true;
316 };
317
318 // Add any enum values defined by this class, overwriting any inherited values
319 for (int ii = 0; ii < metaObject->enumeratorCount(); ++ii) {
321 const bool isScoped = e.isScoped();
322 QStringHash<int> *scoped = isScoped ? new QStringHash<int>() : nullptr;
323
324 // We allow enums in sub-classes to overwrite enums from base-classes, such as
325 // ListView.Center (from enum PositionMode) overwriting Item.Center (from enum TransformOrigin).
326 // This is acceptable because the _use_ of the enum from the QML side requires qualification
327 // anyway, i.e. ListView.Center vs. Item.Center.
328 // However if a class defines two enums with the same value, then that must produce a warning
329 // because it represents a valid conflict.
330 if (e.enclosingMetaObject() != localMetaObject) {
331 localEnums.clear();
332 localMetaObject = e.enclosingMetaObject();
333 }
334 const bool shouldRegisterUnscoped = !isScoped
335 || (regType == QQmlType::CppType && extraData.cppTypeData->registerEnumClassesUnscoped)
336 || (regType == QQmlType::SingletonType && shouldSingletonAlsoRegisterUnscoped())
337 ;
338
339 for (int jj = 0; jj < e.keyCount(); ++jj) {
340 const QString key = QString::fromUtf8(e.key(jj));
341 const int value = e.value(jj);
342 if (shouldRegisterUnscoped) {
343 if (localEnums.contains(key)) {
344 auto existingEntry = enums->enums.find(key);
345 if (existingEntry != enums->enums.end() && existingEntry.value() != value) {
346 qWarning("Previously registered enum will be overwritten due to name clash: %s.%s", metaObject->className(), key.toUtf8().constData());
347 createEnumConflictReport(metaObject, key);
348 }
349 } else {
350 localEnums.insert(key);
351 }
352 enums->enums.insert(key, value);
353 }
354 if (isScoped)
355 scoped->insert(key, value);
356 }
357
358 if (isScoped) {
359 enums->scopedEnums << scoped;
360 enums->scopedEnumIndex.insert(QString::fromUtf8(e.name()), enums->scopedEnums.size()-1);
361 }
362 }
363}
364
365void QQmlTypePrivate::createListOfPossibleConflictingItems(const QMetaObject *metaObject, QList<EnumInfo> &enumInfoList, QStringList path) const
366{
368
369 if (metaObject->d.relatedMetaObjects) {
370 const auto *related = metaObject->d.relatedMetaObjects;
371 if (related) {
372 while (*related)
373 createListOfPossibleConflictingItems(*related++, enumInfoList, path);
374 }
375 }
376
377 for (int ii = 0; ii < metaObject->enumeratorCount(); ++ii) {
378 const auto e = metaObject->enumerator(ii);
379
380 for (int jj = 0; jj < e.keyCount(); ++jj) {
381 const QString key = QString::fromUtf8(e.key(jj));
382
383 EnumInfo enumInfo;
384 enumInfo.metaObjectName = QString::fromUtf8(metaObject->className());
385 enumInfo.enumName = QString::fromUtf8(e.name());
386 enumInfo.enumKey = key;
387 enumInfo.scoped = e.isScoped();
388 enumInfo.path = path;
389 enumInfo.metaEnumScope = QString::fromUtf8(e.scope());
390 enumInfoList.append(enumInfo);
391 }
392 }
393}
394
395void QQmlTypePrivate::createEnumConflictReport(const QMetaObject *metaObject, const QString &conflictingKey) const
396{
397 QList<EnumInfo> enumInfoList;
398
399 if (baseMetaObject) // prefer baseMetaObject if available
401
402 if (!metaObject) { // If there is no metaObject at all return early
403 qWarning() << "No meta object information available. Skipping conflict analysis.";
404 return;
405 }
406
407 createListOfPossibleConflictingItems(metaObject, enumInfoList, QStringList());
408
409 qWarning().noquote() << QLatin1String("Possible conflicting items:");
410 // find items with conflicting key
411 for (const auto &i : std::as_const(enumInfoList)) {
412 if (i.enumKey == conflictingKey)
413 qWarning().noquote().nospace() << " " << i.metaObjectName << "." << i.enumName << "." << i.enumKey << " from scope "
414 << i.metaEnumScope << " injected by " << i.path.join(QLatin1String("->"));
415 }
416}
417
418void QQmlTypePrivate::insertEnumsFromPropertyCache(
419 Enums *enums, const QQmlPropertyCache::ConstPtr &cache) const
420{
421 const QMetaObject *cppMetaObject = cache->firstCppMetaObject();
422
423 for (const QQmlPropertyCache *currentCache = cache.data();
424 currentCache && currentCache->metaObject() != cppMetaObject;
425 currentCache = currentCache->parent().data()) {
426
427 int count = currentCache->qmlEnumCount();
428 for (int ii = 0; ii < count; ++ii) {
429 QStringHash<int> *scoped = new QStringHash<int>();
430 QQmlEnumData *enumData = currentCache->qmlEnum(ii);
431
432 for (int jj = 0; jj < enumData->values.size(); ++jj) {
433 const QQmlEnumValue &value = enumData->values.at(jj);
434 enums->enums.insert(value.namedValue, value.value);
435 scoped->insert(value.namedValue, value.value);
436 }
437 enums->scopedEnums << scoped;
438 enums->scopedEnumIndex.insert(enumData->name, enums->scopedEnums.size()-1);
439 }
440 }
441 insertEnums(enums, cppMetaObject);
442}
443
444void QQmlTypePrivate::setName(const QString &uri, const QString &element)
445{
446 module = uri;
447 elementName = element;
448 name = uri.isEmpty() ? element : (uri + QLatin1Char('/') + element);
449}
450
452{
453 if (d) {
455 return d->extraData.singletonTypeData->singletonInstanceInfo->typeName;
456 else if (d->baseMetaObject)
457 return d->baseMetaObject->className();
458 }
459 return QByteArray();
460}
461
463{
464 if (!d)
465 return QString();
466 return d->elementName;
467}
468
470{
471 if (!d)
472 return QString();
473 return d->name;
474}
475
483{
484 void *unused;
485 return create(&unused, 0);
486}
487
500QObject *QQmlType::create(void **memory, size_t additionalMemory) const
501{
502 if (!d || !isCreatable())
503 return nullptr;
504
505 QObject *rv = (QObject *)operator new(d->extraData.cppTypeData->allocationSize + additionalMemory);
506 d->extraData.cppTypeData->newFunc(rv, d->extraData.cppTypeData->userdata);
507
508 createProxy(rv);
509 *memory = ((char *)rv) + d->extraData.cppTypeData->allocationSize;
510 return rv;
511}
512
519{
520 void *ddataMemory = nullptr;
521 auto instance = create(&ddataMemory, sizeof(QQmlData));
522 if (!instance)
523 return nullptr;
525 Q_ASSERT(!p->isDeletingChildren);
526 if (!p->declarativeData)
527 p->declarativeData = new (ddataMemory) QQmlData(QQmlData::DoesNotOwnMemory);
528 return instance;
529}
530
532{
533 if (!d)
534 return {};
536 return {};
537 return d->extraData.singletonTypeData->singletonInstanceInfo;
538}
539
541{
542 if (!d)
543 return nullptr;
544 if (d->regType != CppType)
545 return nullptr;
546 return d->extraData.cppTypeData->customParser;
547}
548
550{
551 if (!d || d->regType != CppType)
552 return nullptr;
553 return d->extraData.cppTypeData->createValueTypeFunc;
554}
555
557{
558 if (!d || d->regType != CppType)
559 return false;
560 return d->extraData.cppTypeData->constructValueType;
561}
562
564{
565 if (!d || d->regType != CppType)
566 return false;
567 return d->extraData.cppTypeData->populateValueType;
568}
569
571{
572 if (!d || d->regType != CppType)
573 return nullptr;
574 return d->extraData.cppTypeData->newFunc;
575}
576
578{
579 if (!d || d->regType != CppType)
580 return QString();
581 return d->extraData.cppTypeData->noCreationReason;
582}
583
585{
586 return d && d->regType == CppType && d->extraData.cppTypeData->newFunc;
587}
588
590{
591 if (!d)
592 return nullptr;
593
594 switch (d->regType) {
595 case CppType:
596 return d->extraData.cppTypeData->extFunc;
597 case SingletonType:
598 return d->extraData.singletonTypeData->extFunc;
599 default:
600 return nullptr;
601 }
602}
603
605{
606 if (!d)
607 return nullptr;
608
609 switch (d->regType) {
610 case CppType:
611 return d->extraData.cppTypeData->extMetaObject;
612 case SingletonType:
613 return d->extraData.singletonTypeData->extMetaObject;
614 default:
615 return nullptr;
616 }
617}
618
620{
621 return d && !d->init()->data.isEmpty();
622}
623
625{
626 return d && (d->regType == SingletonType || d->regType == CompositeSingletonType);
627}
628
630{
631 return d && d->regType == InterfaceType;
632}
633
635{
636 return d && d->isComposite();
637}
638
640{
641 // if the outer type is a composite singleton, d->regType will indicate that even for
642 // the inline component type
643 // however, inline components can -at least for now- never be singletons
644 // so we just do one additional check
646}
647
649{
650 return d && d->regType == SingletonType && d->extraData.singletonTypeData->singletonInstanceInfo->qobjectCallback;
651}
652
654{
655 return d && d->regType == SingletonType && d->extraData.singletonTypeData->singletonInstanceInfo->scriptCallback;
656}
657
659{
660 return d && d->regType == SequentialContainerType;
661}
662
664{
665 return d && d->isValueType();
666}
667
669{
670 return d ? d->typeId : QMetaType{};
671}
672
674{
675 return d ? d->listId : QMetaType{};
676}
677
679{
680 return isSequentialContainer() ? d->extraData.sequentialContainerTypeData : QMetaSequence();
681}
682
684{
685 return d ? d->metaObject() : nullptr;
686}
687
689{
690 Q_ASSERT(d);
691 return d->metaObjectForValueType();
692}
693
695{
696 return d ? d->baseMetaObject : nullptr;
697}
698
703
705{
706 return d ? d->revision : QTypeRevision();
707}
708
710{
711 if (const QQmlTypePrivate *base = d ? d->attachedPropertiesBase(engine) : nullptr)
712 return base->extraData.cppTypeData->attachedPropertiesFunc;
713 return nullptr;
714}
715
717{
718 if (const QQmlTypePrivate *base = d ? d->attachedPropertiesBase(engine) : nullptr)
719 return base->extraData.cppTypeData->attachedPropertiesType;
720 return nullptr;
721}
722
724{
725 if (!d || d->regType != CppType)
726 return -1;
727 return d->extraData.cppTypeData->parserStatusCast;
728}
729
731{
732 if (!d || d->regType != CppType)
733 return -1;
734 return d->extraData.cppTypeData->propertyValueSourceCast;
735}
736
738{
739 if (!d || d->regType != CppType)
740 return -1;
741 return d->extraData.cppTypeData->propertyValueInterceptorCast;
742}
743
745{
746 if (!d || d->regType != CppType)
747 return -1;
748 return d->extraData.cppTypeData->finalizerCast;
749}
750
751const char *QQmlType::interfaceIId() const
752{
753 if (!d || d->regType != InterfaceType)
754 return nullptr;
755 return d->extraData.interfaceTypeData;
756}
757
759{
760 return d ? d->index : -1;
761}
762
764 return d ? d->regType == QQmlType::InlineComponentType : false;
765}
766
768{
769 return d ? d->sourceUrl() : QUrl();
770}
771
776
781
786
791
796
801
806
808{
809 return QQmlTypePrivate::scopedEnumValue(d, engine, scopedEnumName, name, ok);
810}
811
813{
814 if (priv)
815 priv->addref();
816}
817
819{
820 if (priv)
821 priv->release();
822}
823
825{
826 if (priv)
827 return priv->count();
828 return -1;
829}
830
831void QQmlType::createProxy(QObject *instance) const
832{
833 const QQmlTypePrivate::ProxyMetaObjects *proxies = d->init();
834 if (!proxies->data.isEmpty())
835 (void)new QQmlProxyMetaObject(instance, &proxies->data);
836}
837
\inmodule QtCore
Definition qbytearray.h:57
bool isEmpty() const noexcept
Definition qlist.h:401
const char * value() const
Returns the value of this item.
\inmodule QtCore
const QMetaObject * enclosingMetaObject() const
int value(int index) const
Returns the value with the given index; or returns -1 if there is no such value.
const char * name() const
Returns the name of the type (without the scope).
const char * key(int index) const
Returns the key with the given index, or \nullptr if no such key exists.
int keyCount() const
Returns the number of keys.
bool isScoped() const
const char * scope() const
Returns the scope this enumerator was declared in.
QMetaObject * toMetaObject() const
Converts this meta object builder into a concrete QMetaObject.
\inmodule QtCore
\inmodule QtCore
Definition qmetatype.h:341
const QtPrivate::QMetaTypeInterface * iface() const
Definition qmetatype.h:771
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:150
\inmodule QtCore
Definition qobject.h:103
The QQmlCustomParser class allows you to add new arbitrary types to QML.
@ DoesNotOwnMemory
Definition qqmldata_p.h:58
static QList< QQmlProxyMetaObject::ProxyData > proxyData(const QMetaObject *mo, const QMetaObject *baseMetaObject, QMetaObject *lastMetaObject)
static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd, ClonePolicy policy)
static QQmlType qmlType(const QString &qualifiedName, QTypeRevision version)
Returns the type (if any) of URI-qualified named qualifiedName and version specified by version_major...
static void registerMetaObjectForType(const QMetaObject *metaobject, QQmlTypePrivate *type)
static void unregisterInternalCompositeType(QMetaType metaType, QMetaType listMetaType)
void addref() const
int count() const
void release() const
void setName(const QString &uri, const QString &element)
Definition qqmltype.cpp:444
static int scopedEnumIndex(const QQmlRefPointer< const QQmlTypePrivate > &d, QQmlEnginePrivate *engine, const String &name, bool *ok)
const ProxyMetaObjects * init() const
Definition qqmltype.cpp:173
QTypeRevision revision
QQmlPropertyCache::ConstPtr compositePropertyCache(QQmlEnginePrivate *engine) const
Definition qqmltype.cpp:154
static int enumValue(const QQmlRefPointer< const QQmlTypePrivate > &d, QQmlEnginePrivate *engine, const String &name, bool *ok)
union QQmlTypePrivate::extraData extraData
static int scopedEnumValue(const QQmlRefPointer< const QQmlTypePrivate > &d, QQmlEnginePrivate *engine, int index, const String &name, bool *ok)
const QQmlTypePrivate * attachedPropertiesBase(QQmlEnginePrivate *engine) const
QHashedString QString name
bool isComposite() const
const QMetaObject * metaObject() const
QTypeRevision version
QUrl sourceUrl() const
QQmlTypePrivate(QQmlType::RegistrationType type)
Definition qqmltype.cpp:19
QQmlType::RegistrationType regType
bool isValueType() const
const QMetaObject * baseMetaObject
QQmlType resolveCompositeBaseType(QQmlEnginePrivate *engine) const
Definition qqmltype.cpp:141
const QMetaObject * metaObjectForValueType() const
const QMetaObject * metaObjectForValueType() const
Definition qqmltype.cpp:688
bool isCreatable() const
Definition qqmltype.cpp:584
int propertyValueSourceCast() const
Definition qqmltype.cpp:730
bool isCompositeSingleton() const
Definition qqmltype.cpp:639
bool availableInVersion(QTypeRevision version) const
Definition qqmltype.cpp:119
@ InlineComponentType
Definition qqmltype_p.h:165
@ SingletonType
Definition qqmltype_p.h:161
@ SequentialContainerType
Definition qqmltype_p.h:166
@ CompositeType
Definition qqmltype_p.h:163
@ CompositeSingletonType
Definition qqmltype_p.h:164
@ InterfaceType
Definition qqmltype_p.h:162
int propertyValueInterceptorCast() const
Definition qqmltype.cpp:737
bool canPopulateValueType() const
Definition qqmltype.cpp:563
const char * interfaceIId() const
Definition qqmltype.cpp:751
QTypeRevision version() const
Definition qqmltype.cpp:112
bool isQObjectSingleton() const
Definition qqmltype.cpp:648
QQmlAttachedPropertiesFunc attachedPropertiesFunction(QQmlEnginePrivate *engine) const
Definition qqmltype.cpp:709
QString noCreationReason() const
Definition qqmltype.cpp:577
QMetaType typeId() const
Definition qqmltype.cpp:668
bool isSequentialContainer() const
Definition qqmltype.cpp:658
const QMetaObject * attachedPropertiesType(QQmlEnginePrivate *engine) const
Definition qqmltype.cpp:716
QMetaSequence listMetaSequence() const
Definition qqmltype.cpp:678
bool isValueType() const
Definition qqmltype.cpp:663
QString qmlTypeName() const
Definition qqmltype.cpp:469
int index() const
Definition qqmltype.cpp:758
SingletonInstanceInfo::ConstPtr singletonInstanceInfo() const
Definition qqmltype.cpp:531
CreateValueTypeFunc createValueTypeFunction() const
Definition qqmltype.cpp:549
QMetaType qListTypeId() const
Definition qqmltype.cpp:673
CreateFunc createFunction() const
Definition qqmltype.cpp:570
QHashedString module() const
Definition qqmltype.cpp:105
int scopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *, bool *ok) const
Definition qqmltype.cpp:787
QObject * createWithQQmlData() const
Definition qqmltype.cpp:518
void createProxy(QObject *instance) const
Definition qqmltype.cpp:831
QByteArray typeName() const
Definition qqmltype.cpp:451
static int refCount(const QQmlTypePrivate *priv)
Definition qqmltype.cpp:824
bool canConstructValueType() const
Definition qqmltype.cpp:556
const QMetaObject * baseMetaObject() const
Definition qqmltype.cpp:694
QVariant(* CreateValueTypeFunc)(const QJSValue &)
Definition qqmltype_p.h:66
QUrl sourceUrl() const
Definition qqmltype.cpp:767
const QQmlTypePrivate * priv() const
Definition qqmltype_p.h:154
ExtensionFunc extensionFunction() const
Definition qqmltype.cpp:589
bool isInterface() const
Definition qqmltype.cpp:629
bool isQJSValueSingleton() const
Definition qqmltype.cpp:653
const QMetaObject * metaObject() const
Definition qqmltype.cpp:683
QObject * create() const
Definition qqmltype.cpp:482
static void refHandle(const QQmlTypePrivate *priv)
Definition qqmltype.cpp:812
int enumValue(QQmlEnginePrivate *engine, const QHashedStringRef &, bool *ok) const
Definition qqmltype.cpp:772
static void derefHandle(const QQmlTypePrivate *priv)
Definition qqmltype.cpp:818
QQmlCustomParser * customParser() const
Definition qqmltype.cpp:540
QQmlType & operator=(const QQmlType &other)
bool isComposite() const
Definition qqmltype.cpp:634
QObject *(* ExtensionFunc)(QObject *)
Definition qqmltype_p.h:82
bool isExtendedType() const
Definition qqmltype.cpp:619
const QMetaObject * extensionMetaObject() const
Definition qqmltype.cpp:604
int finalizerCast() const
Definition qqmltype.cpp:744
QTypeRevision metaObjectRevision() const
Definition qqmltype.cpp:704
bool isInlineComponentType() const
Definition qqmltype.cpp:763
QString elementName() const
Definition qqmltype.cpp:462
bool containsRevisionedAttributes() const
Definition qqmltype.cpp:699
int parserStatusCast() const
Definition qqmltype.cpp:723
void(* CreateFunc)(void *, void *)
Definition qqmltype_p.h:76
int scopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::String *, bool *ok) const
Definition qqmltype.cpp:797
bool isSingleton() const
Definition qqmltype.cpp:624
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
\inmodule QtCore
constexpr bool hasMinorVersion() const
Returns true if the minor version is known, otherwise false.
constexpr bool hasMajorVersion() const
Returns true if the major version is known, otherwise false.
constexpr quint8 minorVersion() const
Returns the minor version encoded in the revision.
constexpr quint8 majorVersion() const
Returns the major version encoded in the revision.
\inmodule QtCore
Definition qurl.h:94
QCache< int, Employee > cache
[0]
auto mo
[7]
Combined button and popup list for selecting options.
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qWarning
Definition qlogging.h:166
#define qFatal
Definition qlogging.h:168
static const QMetaObjectPrivate * priv(const uint *data)
GLuint64 key
GLuint index
[2]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint name
GLsizei GLenum GLsizei GLsizei GLuint memory
GLsizei const GLchar *const * path
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
const QMetaObject * dynamicQmlMetaObject(const QtPrivate::QMetaTypeInterface *iface)
QQmlPrivate::QQmlAttachedPropertiesFunc< QObject > QQmlAttachedPropertiesFunc
Definition qqmlprivate.h:63
static bool isPropertyRevisioned(const QMetaObject *mo, int index)
Definition qqmltype.cpp:168
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
static const uint base
Definition qurlidna.cpp:20
obj metaObject() -> className()
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]
QJSEngine engine
[0]
\inmodule QtCore \reentrant
Definition qchar.h:18
\inmodule QtCore
QMetaClassInfo classInfo(int index) const
Returns the meta-data for the item of class information with the given index.
const char * className() const
Returns the class name.
int indexOfClassInfo(const char *name) const
Finds class information item name and returns its index; otherwise returns -1.
QMetaEnum enumerator(int index) const
Returns the meta-data for the enumerator with the given index.
struct QMetaObject::Data d
int enumeratorCount() const
Returns the number of enumerators in this class.
QList< QQmlProxyMetaObject::ProxyData > data
const QMetaObject * attachedPropertiesType
QQmlAttachedPropertiesFunc attachedPropertiesFunc
const QMetaObject * extMetaObject
QObject *(* extFunc)(QObject *)
void(* newFunc)(void *, void *)
QVariant(* createValueTypeFunc)(const QJSValue &)
QQmlType::SingletonInstanceInfo::ConstPtr singletonInstanceInfo
QQmlPropertyCache::ConstPtr rootPropertyCache() const
QQmlSingletonTypeData * singletonTypeData
QMetaSequence sequentialContainerTypeData
QQmlCppTypeData * cppTypeData