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
qqml.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QQML_H
5#define QQML_H
6
7#include <QtQml/qqmlprivate.h>
8#include <QtQml/qjsvalue.h>
9#include <QtQml/qqmlregistration.h>
10
11#include <QtCore/qbytearray.h>
12#include <QtCore/qmetaobject.h>
13#include <QtCore/qmetacontainer.h>
14#include <QtCore/qversionnumber.h>
15
16#define QML_VERSION 0x020000
17#define QML_VERSION_STR "2.0"
18
19#define QML_DECLARE_TYPE(TYPE) \
20 Q_DECLARE_METATYPE(TYPE*) \
21 Q_DECLARE_METATYPE(QQmlListProperty<TYPE>)
22
23#define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \
24 Q_DECLARE_METATYPE(QQmlListProperty<TYPE>)
25
26#define QML_DECLARE_INTERFACE(INTERFACE) \
27 QML_DECLARE_TYPE(INTERFACE)
28
29#define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \
30 QML_DECLARE_TYPE_HASMETATYPE(INTERFACE)
31
32enum { /* TYPEINFO flags */
34};
35
36#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \
37QT_BEGIN_NAMESPACE \
38template <> \
39class QQmlTypeInfo<TYPE > \
40{ \
41public: \
42 enum { \
43 hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \
44 }; \
45}; \
46QT_END_NAMESPACE
47
49
50void Q_QML_EXPORT qmlClearTypeRegistrations();
51
52template<class T>
54
55template<typename T>
87
89template<typename T, int metaObjectRevisionMinor>
125
127template<typename T>
128void qmlRegisterAnonymousTypesAndRevisions(const char *uri, int versionMajor)
129{
130 // Anonymous types are not creatable, no need to warn about missing acceptable constructors.
131 QQmlPrivate::qmlRegisterTypeAndRevisions<T, void>(
132 uri, versionMajor, QQmlPrivate::StaticMetaObject<T>::staticMetaObject(), nullptr,
133 nullptr, true);
134}
135
137{
139 QML_NAMED_ELEMENT(TypeNotAvailable)
141 QML_UNCREATABLE("Type not available.")
142};
143
144int Q_QML_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor,
145 const char *qmlName, const QString &message);
146
147template<typename T>
148int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
149{
154 0,
155 nullptr,
156 nullptr,
157 reason,
159
160 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
162
163 QQmlPrivate::attachedPropertiesFunc<T>(),
164 QQmlPrivate::attachedPropertiesMetaObject<T>(),
165
169
170 nullptr, nullptr,
171
172 nullptr,
176 };
177
179}
180
181template<typename T, int metaObjectRevision>
182int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
183{
188 0,
189 nullptr,
190 nullptr,
191 reason,
193
194 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
196
197 QQmlPrivate::attachedPropertiesFunc<T>(),
198 QQmlPrivate::attachedPropertiesMetaObject<T>(),
199
203
204 nullptr, nullptr,
205
206 nullptr,
207 QTypeRevision::fromMinorVersion(metaObjectRevision),
210 };
211
213}
214
215template<typename T, typename E>
216int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
217{
218 QQmlAttachedPropertiesFunc attached = QQmlPrivate::attachedPropertiesFunc<E>();
219 const QMetaObject * attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<E>();
220 if (!attached) {
221 attached = QQmlPrivate::attachedPropertiesFunc<T>();
222 attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<T>();
223 }
224
229 0,
230 nullptr,
231 nullptr,
232 reason,
234
235 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
237
238 attached,
239 attachedMetaObject,
240
244
246
247 nullptr,
251 };
252
254}
255
256template<typename T, typename E, int metaObjectRevision>
257int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
258{
259 QQmlAttachedPropertiesFunc attached = QQmlPrivate::attachedPropertiesFunc<E>();
260 const QMetaObject * attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<E>();
261 if (!attached) {
262 attached = QQmlPrivate::attachedPropertiesFunc<T>();
263 attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<T>();
264 }
265
270 0,
271 nullptr,
272 nullptr,
273 reason,
275
276 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
278
279 attached,
280 attachedMetaObject,
281
285
287
288 nullptr,
289 QTypeRevision::fromMinorVersion(metaObjectRevision),
292 };
293
295}
296
297Q_QML_EXPORT int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason);
298
299template<typename T>
300int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
301{
302 static_assert(!std::is_abstract_v<T>,
303 "It is not possible to register an abstract type with qmlRegisterType. "
304 "Maybe you wanted qmlRegisterUncreatableType or qmlRegisterInterface?");
305
311 QString(),
313
314 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
316
317 QQmlPrivate::attachedPropertiesFunc<T>(),
318 QQmlPrivate::attachedPropertiesMetaObject<T>(),
319
323
324 nullptr, nullptr,
325
326 nullptr,
330 };
331
333}
334
335template<typename T, int metaObjectRevision>
336int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
337{
338 static_assert(!std::is_abstract_v<T>,
339 "It is not possible to register an abstract type with qmlRegisterType. "
340 "Maybe you wanted qmlRegisterUncreatableType or qmlRegisterInterface?");
341
347 QString(),
349
350 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
352
353 QQmlPrivate::attachedPropertiesFunc<T>(),
354 QQmlPrivate::attachedPropertiesMetaObject<T>(),
355
359
360 nullptr, nullptr,
361
362 nullptr,
363 QTypeRevision::fromMinorVersion(metaObjectRevision),
366 };
367
369}
370
371template<typename T, int metaObjectRevision>
402
403template<typename T, typename E>
404int qmlRegisterExtendedType(const char *uri, int versionMajor)
405{
406 static_assert(!std::is_abstract_v<T>,
407 "It is not possible to register an extension to an abstract type with qmlRegisterExtendedType.");
408
409 static_assert(!std::is_abstract_v<E>,
410 "It is not possible to register an abstract type with qmlRegisterExtendedType. "
411 "Maybe you wanted qmlRegisterExtendedUncreatableType?");
412
417 0,
418 nullptr,
419 nullptr,
420 QString(),
422
423 uri, QTypeRevision::fromVersion(versionMajor, 0), nullptr,
425
426 QQmlPrivate::attachedPropertiesFunc<T>(),
427 QQmlPrivate::attachedPropertiesMetaObject<T>(),
428
432
434
435 nullptr,
439 };
440
442}
443
444template<typename T, typename E>
445int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
446 const char *qmlName)
447{
448 static_assert(!std::is_abstract_v<T>,
449 "It is not possible to register an extension to an abstract type with qmlRegisterExtendedType.");
450
451 static_assert(!std::is_abstract_v<E>,
452 "It is not possible to register an abstract type with qmlRegisterExtendedType. "
453 "Maybe you wanted qmlRegisterExtendedUncreatableType?");
454
455 QQmlAttachedPropertiesFunc attached = QQmlPrivate::attachedPropertiesFunc<E>();
456 const QMetaObject * attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<E>();
457 if (!attached) {
458 attached = QQmlPrivate::attachedPropertiesFunc<T>();
459 attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<T>();
460 }
461
467 QString(),
469
470 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
472
473 attached,
474 attachedMetaObject,
475
479
481
482 nullptr,
486 };
487
489}
490
491template<typename T>
492int qmlRegisterInterface(const char *uri, int versionMajor)
493{
494 QQmlPrivate::RegisterInterface qmlInterface = {
495 0,
496 // An interface is not a QObject itself but is typically casted to one.
497 // Therefore, we still want the pointer.
498 QMetaType::fromType<T *>(),
499 QMetaType::fromType<QQmlListProperty<T> >(),
500 qobject_interface_iid<T *>(),
501
502 uri,
503 QTypeRevision::fromVersion(versionMajor, 0)
504 };
505
507}
508
509template<typename T>
510int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
511 const char *qmlName, QQmlCustomParser *parser)
512{
513 static_assert(!std::is_abstract_v<T>,
514 "It is not possible to register an abstract type with qmlRegisterCustomType. "
515 "Maybe you wanted qmlRegisterUncreatableType or qmlRegisterInterface?");
516
522 QString(),
524
525 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
527
528 QQmlPrivate::attachedPropertiesFunc<T>(),
529 QQmlPrivate::attachedPropertiesMetaObject<T>(),
530
534
535 nullptr, nullptr,
536
537 parser,
541 };
542
544}
545
546template<typename T, int metaObjectRevision>
547int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
548 const char *qmlName, QQmlCustomParser *parser)
549{
550 static_assert(!std::is_abstract_v<T>,
551 "It is not possible to register an abstract type with qmlRegisterCustomType. "
552 "Maybe you wanted qmlRegisterUncreatableType or qmlRegisterInterface?");
553
559 QString(),
561
562 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
564
565 QQmlPrivate::attachedPropertiesFunc<T>(),
566 QQmlPrivate::attachedPropertiesMetaObject<T>(),
567
571
572 nullptr, nullptr,
573
574 parser,
575 QTypeRevision::fromMinorVersion(metaObjectRevision),
578 };
579
581}
582
583template<typename T, typename E>
584int qmlRegisterCustomExtendedType(const char *uri, int versionMajor, int versionMinor,
585 const char *qmlName, QQmlCustomParser *parser)
586{
587 static_assert(!std::is_abstract_v<T>,
588 "It is not possible to register an extension to an abstract type with qmlRegisterCustomExtendedType.");
589
590 static_assert(!std::is_abstract_v<E>,
591 "It is not possible to register an abstract type with qmlRegisterCustomExtendedType.");
592
593 QQmlAttachedPropertiesFunc attached = QQmlPrivate::attachedPropertiesFunc<E>();
594 const QMetaObject * attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<E>();
595 if (!attached) {
596 attached = QQmlPrivate::attachedPropertiesFunc<T>();
597 attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<T>();
598 }
599
605 QString(),
607
608 uri, QTypeRevision::fromVersion(versionMajor, versionMinor), qmlName,
610
611 attached,
612 attachedMetaObject,
613
617
619
620 parser,
624 };
625
627}
628
629class QQmlContext;
630class QQmlEngine;
631class QJSValue;
632class QJSEngine;
633
634Q_QML_EXPORT void qmlExecuteDeferred(QObject *);
635Q_QML_EXPORT QQmlContext *qmlContext(const QObject *);
636Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *);
638 const QMetaObject *);
640 bool create = true);
641Q_QML_EXPORT QObject *qmlExtendedObject(QObject *);
642
643//The C++ version of protected namespaces in qmldir
644Q_QML_EXPORT bool qmlProtectModule(const char* uri, int majVersion);
645Q_QML_EXPORT void qmlRegisterModule(const char *uri, int versionMajor, int versionMinor);
646
652
653Q_QML_EXPORT void qmlRegisterModuleImport(const char *uri, int moduleMajor,
654 const char *import,
655 int importMajor = QQmlModuleImportLatest,
656 int importMinor = QQmlModuleImportLatest);
657Q_QML_EXPORT void qmlUnregisterModuleImport(const char *uri, int moduleMajor,
658 const char *import,
659 int importMajor = QQmlModuleImportLatest,
660 int importMinor = QQmlModuleImportLatest);
661
662template<typename T>
664{
665 // We don't need a concrete object to resolve the function. As T is a C++ type, it and all its
666 // super types should be registered as CppType (or not at all). We only need the object and its
667 // QML engine to resolve composite types. Therefore, the function is actually a static property
668 // of the C++ type system and we can cache it here for improved performance on further lookups.
669 static const auto func = qmlAttachedPropertiesFunction(nullptr, &T::staticMetaObject);
670 return qmlAttachedPropertiesObject(const_cast<QObject *>(obj), func, create);
671}
672
673#ifdef Q_QDOC
675 const char *uri, int versionMajor, int versionMinor, const char *typeName,
676 std::function<QJSValue(QQmlEngine *, QJSEngine *)> callback)
677#else
678template<typename F, typename std::enable_if<std::is_convertible<F, std::function<QJSValue(QQmlEngine *, QJSEngine *)>>::value, void>::type* = nullptr>
680 const char *uri, int versionMajor, int versionMinor, const char *typeName, F &&callback)
681#endif
682{
684 0,
685 uri,
686 QTypeRevision::fromVersion(versionMajor, versionMinor),
687 typeName,
688 std::forward<F>(callback),
689 nullptr,
690 nullptr,
691 QMetaType(),
692 nullptr, nullptr,
694 };
695
697}
698
699#ifdef Q_QDOC
700template <typename T>
702 const char *uri, int versionMajor, int versionMinor, const char *typeName,
703 std::function<QObject *(QQmlEngine *, QJSEngine *)> callback)
704#else
705template<typename T, typename F, typename std::enable_if<std::is_convertible<F, std::function<QObject *(QQmlEngine *, QJSEngine *)>>::value, void>::type* = nullptr>
707 const char *uri, int versionMajor, int versionMinor, const char *typeName, F &&callback)
708#endif
709{
711 0,
712 uri,
713 QTypeRevision::fromVersion(versionMajor, versionMinor),
714 typeName,
715 nullptr,
716 std::forward<F>(callback),
719 nullptr, nullptr,
721 };
722
724}
725
726#ifdef Q_QDOC
727int qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, const char *typeName, QObject *cppObject)
728#else
729template<typename T>
730inline auto qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor,
731 const char *typeName, T *cppObject) -> typename std::enable_if<std::is_base_of<QObject, T>::value, int>::type
732#endif
733{
734 QQmlPrivate::SingletonInstanceFunctor registrationFunctor;
735 registrationFunctor.m_object = cppObject;
736 return qmlRegisterSingletonType<T>(uri, versionMajor, versionMinor, typeName, registrationFunctor);
737}
738
739inline int qmlRegisterSingletonType(const QUrl &url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
740{
741 if (url.isRelative()) {
742 // User input check must go here, because QQmlPrivate::qmlregister is also used internally for composite types
743 qWarning("qmlRegisterSingletonType requires absolute URLs.");
744 return 0;
745 }
746
748 0,
749 url,
750 uri,
751 QTypeRevision::fromVersion(versionMajor, versionMinor),
752 qmlName
753 };
754
756}
757
758inline int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
759{
760 if (url.isRelative()) {
761 // User input check must go here, because QQmlPrivate::qmlregister is also used internally for composite types
762 qWarning("qmlRegisterType requires absolute URLs.");
763 return 0;
764 }
765
767 0,
768 url,
769 uri,
770 QTypeRevision::fromVersion(versionMajor, versionMinor),
771 qmlName
772 };
773
775}
776
777template<typename Container>
778inline int qmlRegisterAnonymousSequentialContainer(const char *uri, int versionMajor)
779{
780 static_assert(!std::is_abstract_v<Container>,
781 "It is not possible to register an abstract container with qmlRegisterAnonymousSequentialContainer.");
782
784 0,
785 uri,
787 nullptr,
788 QMetaType::fromType<Container>(),
789 QMetaSequence::fromContainer<Container>(),
791 };
792
794}
795
796template<class T, class Resolved, class Extended, bool Singleton, bool Interface, bool Sequence, bool Uncreatable>
798
799template<class T, class Resolved, class Extended>
800struct QmlTypeAndRevisionsRegistration<T, Resolved, Extended, false, false, false, false> {
801 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
802 const QMetaObject *extension)
803 {
804#if QT_DEPRECATED_SINCE(6, 4)
805 // ### Qt7: Remove the warnings, and leave only the static asserts below.
808 QMetaType::fromType<Resolved>());
809 }
810
811 if constexpr (!std::is_base_of_v<QObject, Resolved>
814 QMetaType::fromType<Resolved>());
815 }
816#else
818 "This type is neither a default constructible QObject, nor a default- "
819 "and copy-constructible Q_GADGET, nor marked as uncreatable.\n"
820 "You should not use it as a QML type.");
821 static_assert(std::is_base_of_v<QObject, Resolved>
823#endif
824 QQmlPrivate::qmlRegisterTypeAndRevisions<Resolved, Extended>(
826 qmlTypeIds, extension);
827 }
828};
829
830template<class T, class Resolved, class Extended>
831struct QmlTypeAndRevisionsRegistration<T, Resolved, Extended, false, false, false, true> {
832 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
833 const QMetaObject *extension)
834 {
835#if QT_DEPRECATED_SINCE(6, 4)
836 // ### Qt7: Remove the warning, and leave only the static assert below.
837 if constexpr (!std::is_base_of_v<QObject, Resolved>
840 QMetaType::fromType<Resolved>());
841 }
842#else
843 static_assert(std::is_base_of_v<QObject, Resolved>
845#endif
846 QQmlPrivate::qmlRegisterTypeAndRevisions<Resolved, Extended>(
848 qmlTypeIds, extension);
849 }
850};
851
852template<class T, class Resolved>
853struct QmlTypeAndRevisionsRegistration<T, Resolved, void, false, false, true, true> {
854 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
855 const QMetaObject *)
856 {
857 // Sequences have to be anonymous for now, which implies uncreatable.
858 QQmlPrivate::qmlRegisterSequenceAndRevisions<Resolved>(
860 qmlTypeIds);
861 }
862};
863
864template<class T, class Resolved, class Extended>
865struct QmlTypeAndRevisionsRegistration<T, Resolved, Extended, true, false, false, false> {
866 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
867 const QMetaObject *extension)
868 {
869#if QT_DEPRECATED_SINCE(6, 4)
870 // ### Qt7: Remove the warning, and leave only the static assert below.
871 if constexpr (QQmlPrivate::singletonConstructionMode<Resolved, T>()
874 QMetaType::fromType<Resolved>());
875 }
876#else
877 static_assert(QQmlPrivate::singletonConstructionMode<Resolved, T>()
879 "A singleton needs either a default constructor or, when adding a default "
880 "constructor is infeasible, a public static "
881 "create(QQmlEngine *, QJSEngine *) method");
882#endif
883
884 QQmlPrivate::qmlRegisterSingletonAndRevisions<Resolved, Extended, T>(
886 qmlTypeIds, extension);
887 }
888};
889
890template<class T, class Resolved, class Extended>
891struct QmlTypeAndRevisionsRegistration<T, Resolved, Extended, true, false, false, true> {
892 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
893 const QMetaObject *extension)
894 {
895 // An uncreatable singleton makes little sense? OK, you can still use the enums.
896 QQmlPrivate::qmlRegisterSingletonAndRevisions<Resolved, Extended, T>(
898 qmlTypeIds, extension);
899 }
900};
901
902template<class T, class Resolved>
903struct QmlTypeAndRevisionsRegistration<T, Resolved, void, false, true, false, false> {
904 static void registerTypeAndRevisions(const char *uri, int versionMajor, QList<int> *qmlTypeIds,
905 const QMetaObject *)
906 {
907 const int id = qmlRegisterInterface<Resolved>(uri, versionMajor);
908 if (qmlTypeIds)
909 qmlTypeIds->append(id);
910 }
911};
912
913template<typename... T>
926
928 const char *uri, int versionMajor,
929 QList<int> *qmlTypeIds,
930 const QMetaObject *classInfoMetaObject,
931 const QMetaObject *extensionMetaObject)
932{
934 3,
935 QMetaType(),
936 QMetaType(),
937 0,
938 nullptr,
939 nullptr,
940 nullptr,
941
942 uri,
944
946 (classInfoMetaObject ? classInfoMetaObject : metaObject),
947
948 nullptr,
949 nullptr,
950
951 -1,
952 -1,
953 -1,
954
955 nullptr,
956 extensionMetaObject,
957
958 &qmlCreateCustomParser<void>,
959 qmlTypeIds,
960 -1,
961 false,
963 };
964
966}
967
969 const char *uri, int versionMajor,
970 QList<int> *qmlTypeIds = nullptr,
971 const QMetaObject *classInfoMetaObject = nullptr)
972{
973 qmlRegisterNamespaceAndRevisions(metaObject, uri, versionMajor, qmlTypeIds,
974 classInfoMetaObject, nullptr);
975}
976
977int Q_QML_EXPORT qmlTypeId(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
978
980
981#endif // QQML_H
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
\inmodule QtCore
\inmodule QtCore
Definition qmetatype.h:341
\inmodule QtCore
Definition qobject.h:103
The QQmlContext class defines a context within a QML engine.
Definition qqmlcontext.h:25
The QQmlCustomParser class allows you to add new arbitrary types to QML.
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static constexpr QTypeRevision fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a val...
static constexpr QTypeRevision fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
\inmodule QtCore
Definition qurl.h:94
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
Definition qurl.cpp:2800
void extension()
[6]
Definition dialogs.cpp:230
Q_QML_EXPORT void qmlRegistrationWarning(QmlRegistrationWarning warning, QMetaType type)
Definition qqml.cpp:153
@ CompositeSingletonRegistration
@ SingletonRegistration
@ SequentialContainerRegistration
@ CompositeRegistration
@ InterfaceRegistration
@ TypeAndRevisionsRegistration
@ UnconstructibleSingleton
int Q_QML_EXPORT qmlregister(RegistrationType, void *)
Definition qqml.cpp:771
Combined button and popup list for selecting options.
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
#define qWarning
Definition qlogging.h:166
const char * typeName
GLenum type
GLuint GLsizei const GLchar * message
GLhandleARB obj
[2]
GLenum func
Definition qopenglext.h:663
Q_QML_EXPORT QQmlEngine * qmlEngine(const QObject *)
Definition qqml.cpp:80
Q_QML_EXPORT void qmlRegisterModuleImport(const char *uri, int moduleMajor, const char *import, int importMajor=QQmlModuleImportLatest, int importMinor=QQmlModuleImportLatest)
QQmlCustomParser * qmlCreateCustomParser()
Definition qqmlprivate.h:90
Q_QML_EXPORT bool qmlProtectModule(const char *uri, int majVersion)
Definition qqml.cpp:238
int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
Definition qqml.h:300
int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
Definition qqml.h:148
void qmlRegisterAnonymousTypesAndRevisions(const char *uri, int versionMajor)
Definition qqml.h:128
int Q_QML_EXPORT qmlTypeId(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
Definition qqml.cpp:357
int qmlRegisterCustomExtendedType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, QQmlCustomParser *parser)
Definition qqml.h:584
int Q_QML_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &message)
Definition qqml.cpp:913
void qmlRegisterNamespaceAndRevisions(const QMetaObject *metaObject, const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *classInfoMetaObject, const QMetaObject *extensionMetaObject)
Definition qqml.h:927
void qmlRegisterTypesAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds)
Definition qqml.h:914
@ QML_HAS_ATTACHED_PROPERTIES
Definition qqml.h:33
int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
Definition qqml.h:216
int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, QQmlCustomParser *parser)
Definition qqml.h:510
int qmlRegisterExtendedType(const char *uri, int versionMajor)
Definition qqml.h:404
int qmlRegisterAnonymousSequentialContainer(const char *uri, int versionMajor)
Definition qqml.h:778
auto qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, const char *typeName, T *cppObject) -> typename std::enable_if< std::is_base_of< QObject, T >::value, int >::type
Definition qqml.h:730
Q_QML_EXPORT QObject * qmlExtendedObject(QObject *)
Definition qqml.cpp:129
QQmlModuleImportSpecialVersions
Definition qqml.h:647
@ QQmlModuleImportLatest
Definition qqml.h:649
@ QQmlModuleImportModuleAny
Definition qqml.h:648
@ QQmlModuleImportAuto
Definition qqml.h:650
int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor)
Definition qqml.h:372
QT_BEGIN_NAMESPACE void Q_QML_EXPORT qmlClearTypeRegistrations()
Definition qqml.cpp:230
Q_QML_EXPORT int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
Definition qqml.cpp:195
int qmlRegisterSingletonType(const char *uri, int versionMajor, int versionMinor, const char *typeName, F &&callback)
Definition qqml.h:679
Q_QML_EXPORT QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *, const QMetaObject *)
Definition qqml.cpp:106
Q_QML_EXPORT void qmlUnregisterModuleImport(const char *uri, int moduleMajor, const char *import, int importMajor=QQmlModuleImportLatest, int importMinor=QQmlModuleImportLatest)
int qmlRegisterAnonymousType(const char *uri, int versionMajor)
Definition qqml.h:56
Q_QML_EXPORT void qmlRegisterModule(const char *uri, int versionMajor, int versionMinor)
Definition qqml.cpp:245
Q_QML_EXPORT void qmlExecuteDeferred(QObject *)
Definition qqml.cpp:49
Q_QML_EXPORT QObject * qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc func, bool create=true)
Definition qqml.cpp:114
Q_QML_EXPORT QQmlContext * qmlContext(const QObject *)
Definition qqml.cpp:75
int qmlRegisterInterface(const char *uri, int versionMajor)
Definition qqml.h:492
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
QQmlPrivate::QQmlAttachedPropertiesFunc< QObject > QQmlAttachedPropertiesFunc
Definition qqmlprivate.h:63
#define Q_OBJECT
QUrl url("example.com")
[constructor-url-reference]
obj metaObject() -> className()
QNetworkRequestFactory api
[0]
view create()
\inmodule QtCore
static constexpr QMetaType list()
static constexpr QMetaType self()
static constexpr bool hasAcceptableCtors()
static const QMetaObject * staticMetaObject()
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *extension)
Definition qqml.h:801
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *extension)
Definition qqml.h:832
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *extension)
Definition qqml.h:866
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *extension)
Definition qqml.h:892
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *)
Definition qqml.h:854
static void registerTypeAndRevisions(const char *uri, int versionMajor, QList< int > *qmlTypeIds, const QMetaObject *)
Definition qqml.h:904