18#include <QtQml/qtqmlglobal.h>
19#include <QtQml/qqmlparserstatus.h>
20#include <QtQml/qqmllist.h>
21#include <QtQml/qqmlpropertyvaluesource.h>
22#include <QtQml/qjsvalue.h>
24#include <QtCore/qglobal.h>
25#include <QtCore/qvariant.h>
26#include <QtCore/qurl.h>
27#include <QtCore/qpointer.h>
28#include <QtCore/qversionnumber.h>
30#include <QtCore/qmetaobject.h>
31#include <QtCore/qmetacontainer.h>
32#include <QtCore/qdebug.h>
51struct ExecutionEngine;
52class ExecutableCompilationUnit;
53namespace CompiledData {
69template <
typename TYPE>
100 static void operator delete(
void *
ptr) {
106 ::operator
delete (
ptr);
109 static void operator delete(
void *,
void *) {
125 template<
typename T,
typename WrapperT = T,
typename = std::
void_t<>>
128 static constexpr bool value =
false;
131 template<
typename T,
typename WrapperT>
133 static_cast<QQmlEngine *>(nullptr),
134 static_cast<QJSEngine *>(nullptr)))>>
136 static constexpr bool value = std::is_same_v<
137 decltype(WrapperT::create(
static_cast<QQmlEngine *
>(
nullptr),
138 static_cast<QJSEngine *
>(
nullptr))), T *>;
141 template<
typename T,
typename WrapperT>
144 if constexpr (!std::is_base_of<QObject, T>::value)
148 if constexpr (std::is_default_constructible<T>::value)
159 template<
typename Ret,
typename Class>
165 template<
typename T,
typename Marker>
171 template<
typename T,
typename WrapperT, SingletonConstructionMode Mode>
179 return T::create(
q,
j);
181 return WrapperT::create(
q,
j);
194 template<
typename T,
typename WrapperT = T,
198 template<
typename T,
typename WrapperT>
202 = QQmlPrivate::createInto<T>;
208 template<
typename T,
typename WrapperT>
215 template<
typename T,
typename WrapperT>
224 template<
typename T,
typename WrapperT>
234 bool IsObject = std::is_base_of<QObject, T>::value,
261 template<
typename F,
typename Result =
void>
276 template<
typename T,
typename F,
277 bool HasCtor = std::is_constructible_v<T, QJSValue>,
278 bool HasFactory = std::is_constructible_v<
282 template<
typename T,
typename F>
288 template<
typename T,
typename F,
bool HasCtor>
297 template<
typename T,
typename F>
306 template<
class From,
class To,
int N>
309 static inline int cast() {
return -1; }
312 template<
class From,
class To>
315 static inline int cast() {
return int(
reinterpret_cast<quintptr>(
static_cast<To *
>(
reinterpret_cast<From *
>(0x10000000)))) - 0x10000000; }
318 template<
class From,
class To>
335 template<
class T,
class A>
341 template<
class T,
class = std::
void_t<>,
bool OldStyle = QQmlTypeInfo<T>::hasAttachedProperties>
352 struct QmlAttached<T,
std::void_t<typename OverridableAttachedType<T, typename T::QmlAttachedType>::Type>,
false>
355 template <
typename Parent,
typename Attached>
364 template<
typename Parent>
365 struct Properties<Parent,
void>
372 using Type =
typename std::conditional<
379 return Properties<T, Type>::staticMetaObject();
384 return Properties<T, Type>::attachedPropertiesFunc();
392 using Type =
typename std::remove_pointer<
decltype(T::qmlAttachedProperties(
nullptr))>
::type;
616 enum:
uint { InvalidStringId = (std::numeric_limits<uint>::max)() };
630 void setInstructionPointer(
int offset)
const;
631 void setReturnValueUndefined()
const;
635 bool captureQmlContextPropertyLookup(
uint index)
const;
636 void captureTranslation()
const;
637 QString translationContext()
const;
640 QJSValue javaScriptGlobalProperty(
uint nameIndex)
const;
650 int ctorIndex,
void *ctorArg)
const;
671 bool callQmlContextPropertyLookup(
673 void initCallQmlContextPropertyLookup(
uint index)
const;
676 void initLoadContextIdLookup(
uint index)
const;
680 void initCallObjectPropertyLookup(
uint index)
const;
683 void initCallGlobalLookup(
uint index)
const;
686 void initLoadGlobalLookup(
uint index)
const;
692 void initLoadSingletonLookup(
uint index,
uint importNamespace)
const;
698 void initLoadTypeLookup(
uint index,
uint importNamespace)
const;
708 const char *enumerator,
const char *enumValue)
const;
724#if QT_DEPRECATED_SINCE(6, 6)
758#if QT_DEPRECATED_SINCE(6, 3)
759 struct Q_QML_EXPORT SingletonFunctor
763 bool alreadyCalled =
false;
785 const int start = (startOffset == -1)
804 return (
index == -1) ? defaultValue
812 bool defaultValue =
false)
823 if (
qstrcmp(elementName,
"auto") == 0) {
824 const char *strippedClassName =
metaObject->className();
825 for (
const char *
c = strippedClassName; *
c !=
'\0';
c++) {
827 strippedClassName =
c + 1;
830 return strippedClassName;
832 if (
qstrcmp(elementName,
"anonymous") == 0)
836 qWarning().nospace() <<
"Missing QML.Element class info \"" << elementName <<
"\""
843 template<
class T,
class = std::
void_t<>>
852 using Type =
typename std::conditional<
854 typename T::QmlExtendedType,
void>
::type;
857 template<
class T,
class = std::
void_t<>>
869 return T::qmlExtendedNamespace();
875 template<
class T,
class = std::
void_t<>>
884 using Type =
typename std::conditional<
886 typename T::QmlForeignType, T>
::type;
889 template<
class T,
class = std::
void_t<>>
892 static constexpr bool Value =
false;
900 &&
bool(T::QmlIsUncreatable::yes);
903 template<
class T,
class = std::
void_t<>>
906 static constexpr bool Value =
false;
914 &&
bool(T::QmlIsAnonymous::yes);
918 template<
class T,
class = std::
void_t<>>
921 static constexpr bool Value =
false;
929 &&
bool(T::QmlIsSingleton::yes);
932 template<
class T,
class = std::
void_t<>>
935 static constexpr bool Value =
false;
943 static constexpr bool Value = bool(T::QmlIsSequence::yes);
946 template<
class T,
class = std::
void_t<>>
949 static constexpr bool Value =
false;
955 static constexpr bool Value = bool(T::QmlIsInterface::yes);
958 template<
class T,
typename = std::
void_t<>>
975 if constexpr (!std::is_default_constructible_v<T>)
977 else if constexpr (std::is_base_of_v<QObject, T>)
980 return std::is_copy_constructible_v<T>;
985 if constexpr (std::is_base_of_v<QObject, T>)
986 return QMetaType::fromType<T*>();
988 return QMetaType::fromType<T>();
993 if constexpr (std::is_base_of_v<QObject, T>)
996 return QMetaType::fromType<QList<T>>();
1001 if constexpr (std::is_base_of_v<QObject, T>)
1004 return QMetaSequence::fromContainer<QList<T>>();
1008 template<
typename T,
typename E,
typename WrapperT = T>
1013 static_assert(std::is_base_of_v<QObject, T>);
1023 classInfoMetaObject,
1036 template<
typename T,
typename E>
1040 bool forceAnonymous =
false)
1055 classInfoMetaObject,
1057 attachedPropertiesFunc<T>(),
1058 attachedPropertiesMetaObject<T>(),
1067 &qmlCreateCustomParser<T>,
1081 template<
typename T>
1090 classInfoMetaObject,
1091 QMetaType::fromType<T>(),
1092 QMetaSequence::fromContainer<T>(),
1101 const char *uri,
int versionMajor,
const QMetaObject *classInfoMetaObject,
The QJSEngine class provides an environment for evaluating JavaScript code.
The QJSValue class acts as a container for Qt/JavaScript data types.
int toInt(bool *ok=nullptr, int base=10) const
The QQmlCustomParser class allows you to add new arbitrary types to QML.
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
The QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static constexpr QTypeRevision fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given value.
static constexpr QTypeRevision fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QList< QVariant > arguments
void qmlRegisterTypeAndRevisions(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds, const QMetaObject *extension, bool forceAnonymous=false)
QTypeRevision revisionClassInfo(const QMetaObject *metaObject, const char *key, QTypeRevision defaultValue=QTypeRevision())
void Q_QML_EXPORT qmlunregister(RegistrationType, quintptr)
void(*)(void *, void *) CreateIntoFunction
QObject * createParent(QObject *p)
QObject *(*)(QQmlEngine *, QJSEngine *) CreateSingletonFunction
constexpr QtPrivate::QMetaTypeInterface metaTypeForNamespace(const QtPrivate::QMetaTypeInterface::MetaObjectFn &metaObjectFunction, const char *name)
QObject * createSingletonInstance(QQmlEngine *q, QJSEngine *j)
static int indexOfOwnClassInfo(const QMetaObject *metaObject, const char *key, int startOffset=-1)
void createInto(void *memory, void *)
void Q_QML_EXPORT qdeclarativeelement_destructor(QObject *)
A *(*)(QObject *) QQmlAttachedPropertiesFunc
void qmlRegisterSingletonAndRevisions(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds, const QMetaObject *extension)
Q_QML_EXPORT void qmlRegistrationWarning(QmlRegistrationWarning warning, QMetaType type)
@ CompositeSingletonRegistration
@ SequentialContainerRegistration
@ SequentialContainerAndRevisionsRegistration
@ QmlUnitCacheHookRegistration
@ SingletonAndRevisionsRegistration
@ TypeAndRevisionsRegistration
void qmlRegisterSequenceAndRevisions(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds)
QVariant(*)(const QJSValue &) CreateValueTypeFunction
SingletonConstructionMode
Q_QML_EXPORT QList< QTypeRevision > revisionClassInfos(const QMetaObject *metaObject, const char *key)
QQmlAttachedPropertiesFunc< QObject > attachedPropertiesFunc()
@ UnconstructibleSingleton
Q_QML_EXPORT QObject * qmlExtendedObject(QObject *, int)
constexpr SingletonConstructionMode singletonConstructionMode()
const CachedQmlUnit *(* QmlUnitCacheLookupFunction)(const QUrl &url)
const QMetaObject * attachedPropertiesMetaObject()
const char * classInfo(const QMetaObject *metaObject, const char *key)
std::is_same< T, typename QmlMarkerFunction< Marker >::ClassType > QmlTypeHasMarker
bool boolClassInfo(const QMetaObject *metaObject, const char *key, bool defaultValue=false)
int Q_QML_EXPORT qmlregister(RegistrationType, void *)
QObject *(*)(QObject *) CreateParentFunction
AutoParentResult(* AutoParentFunction)(QObject *object, QObject *parent)
void qmlRegisterTypeAndRevisions< QQmlTypeNotAvailable, void >(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds, const QMetaObject *extension, bool)
const char * classElementName(const QMetaObject *metaObject)
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
void(* IRLoaderFunction)(Document *, const QQmlPrivate::CachedQmlUnit *)
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
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
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static ControlElement< T > * ptr(QWidget *widget)
GLsizei const GLfloat * v
[13]
GLsizei GLenum GLenum * types
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLsizei GLenum GLsizei GLsizei GLuint memory
GLdouble GLdouble GLdouble GLdouble q
QQmlEngine * qmlEngine(const QObject *obj)
static ReturnedValue writeToConsole(const FunctionObject *b, const Value *argv, int argc, ConsoleLogTypes logType, bool printStack=false)
QQmlCustomParser * qmlCreateCustomParser()
size_t qHash(QQmlAttachedPropertiesFunc func, size_t seed=0)
QQmlPrivate::QQmlAttachedPropertiesFunc< QObject > QQmlAttachedPropertiesFunc
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QT_DEPRECATED_VERSION_X(major, minor, text)
QUrl url("example.com")
[constructor-url-reference]
obj metaObject() -> className()
QQmlContextData * qmlContext
QV4::ExecutableCompilationUnit * compilationUnit
void(* functionPtr)(const AOTCompiledContext *context, void *resultPtr, void **arguments)
QList< QMetaType > argumentTypes
const AOTCompiledFunction * aotCompiledFunctions
const QV4::CompiledData::Unit * qmlData
static const QMetaObject * staticMetaObject()
static const QMetaObject * staticMetaObject()
static const QMetaObject * staticMetaObject()
static constexpr bool Value
static QQmlAttachedPropertiesFunc< QObject > attachedPropertiesFunc()
static const QMetaObject * staticMetaObject()
static Func attachedPropertiesFunc()
static const QMetaObject * staticMetaObject()
QQmlAttachedPropertiesFunc< Type > Func
static const QMetaObject * staticMetaObject()
static Func attachedPropertiesFunc()
typename Properties< T, Type >::Func Func
static const QMetaObject * staticMetaObject()
QQmlAttachedPropertiesFunc< Attached > Func
static Func attachedPropertiesFunc()
static const QMetaObject * staticMetaObject()
QQmlAttachedPropertiesFunc< QObject > Func
static Func attachedPropertiesFunc()
QQmlAttachedPropertiesFunc< QObject > Func
static Func attachedPropertiesFunc()
static const QMetaObject * staticMetaObject()
static constexpr const QMetaObject * metaObject()
static constexpr const QMetaObject * metaObject()
static constexpr bool Value
Q_STATIC_ASSERT((std::is_same_v< typename T::QmlSequenceValueType, typename QmlResolved< T >::Type::value_type >))
static constexpr bool Value
static constexpr bool Value
static constexpr bool Value
AutoParentFunction function
QmlUnitCacheLookupFunction lookupCachedQmlUnit
QVector< int > * qmlTypeIds
const QMetaObject * classInfoMetaObject
QMetaSequence metaSequence
QMetaSequence metaSequence
const QMetaObject * instanceMetaObject
const QMetaObject * classInfoMetaObject
std::function< QObject *(QQmlEngine *, QJSEngine *)> qObjectApi
const QMetaObject * extensionMetaObject
QVector< int > * qmlTypeIds
std::function< QObject *(QQmlEngine *, QJSEngine *)> qObjectApi
std::function< QJSValue(QQmlEngine *, QJSEngine *)> scriptApi
const QMetaObject * extensionMetaObject
const QMetaObject * instanceMetaObject
QQmlAttachedPropertiesFunc< QObject > attachedPropertiesFunction
QVariant(* createValueType)(const QJSValue &)
const QMetaObject * extensionMetaObject
const QMetaObject * metaObject
void(* create)(void *, void *)
QMetaSequence listMetaSequence
const QMetaObject * classInfoMetaObject
const QMetaObject * attachedPropertiesMetaObject
QVector< int > * qmlTypeIds
QQmlCustomParser * customParser
void(* create)(void *, void *)
QQmlAttachedPropertiesFunc< QObject > attachedPropertiesFunction
QVariant(* createValueType)(const QJSValue &)
const QMetaObject * extensionMetaObject
const QMetaObject * metaObject
const QMetaObject * attachedPropertiesMetaObject
bool has(StructVersion v) const
ValueTypeCreationMethod creationMethod
QPointer< QObject > m_object
static no_type checkType(...)
static yes_type checkType(To *)
static decltype(F::create(QJSValue())) create(const QJSValue ¶ms)
static constexpr const Result(* create)(const QJSValue &)
static QVariant create(const QJSValue ¶ms)
static QVariant create(const QJSValue ¶ms)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent