18#include <QtQml/qjsprimitivevalue.h>
19#include <QtQml/qjsvalue.h>
20#include <QtQml/qqmllist.h>
21#include <QtQml/qqmlparserstatus.h>
22#include <QtQml/qqmlpropertyvaluesource.h>
23#include <QtQml/qtqmlglobal.h>
25#include <QtCore/qdatetime.h>
26#include <QtCore/qdebug.h>
27#include <QtCore/qglobal.h>
28#include <QtCore/qmetacontainer.h>
29#include <QtCore/qmetaobject.h>
30#include <QtCore/qpointer.h>
31#include <QtCore/qurl.h>
32#include <QtCore/qvariant.h>
33#include <QtCore/qversionnumber.h>
52struct ExecutionEngine;
53class ExecutableCompilationUnit;
54namespace CompiledData {
70template <
typename TYPE>
105 static void operator delete(
void *
ptr) {
111 ::operator
delete (
ptr);
114 static void operator delete(
void *,
void *) {
130 template<
typename T,
typename WrapperT = T,
typename = std::
void_t<>>
133 static constexpr bool value =
false;
136 template<
typename T,
typename WrapperT>
138 static_cast<QQmlEngine *>(nullptr),
139 static_cast<QJSEngine *>(nullptr)))>>
141 static constexpr bool value = std::is_same_v<
142 decltype(WrapperT::create(
static_cast<QQmlEngine *
>(
nullptr),
143 static_cast<QJSEngine *
>(
nullptr))), T *>;
146 template<
typename T,
typename WrapperT>
149 if constexpr (!std::is_base_of<QObject, T>::value)
153 if constexpr (std::is_default_constructible<T>::value)
164 template<
typename Ret,
typename Class>
170 template<
typename T,
typename Marker>
176 template<
typename T,
typename WrapperT, SingletonConstructionMode Mode>
184 return T::create(
q,
j);
186 return WrapperT::create(
q,
j);
199 template<
typename T,
typename WrapperT = T,
203 template<
typename T,
typename WrapperT>
207 = QQmlPrivate::createInto<T>;
213 template<
typename T,
typename WrapperT>
220 template<
typename T,
typename WrapperT>
229 template<
typename T,
typename WrapperT>
239 bool IsObject = std::is_base_of<QObject, T>::value,
266 template<
typename F,
typename Result =
void>
281 template<
typename T,
typename F,
282 bool HasCtor = std::is_constructible_v<T, QJSValue>,
283 bool HasFactory = std::is_constructible_v<
287 template<
typename T,
typename F>
288 struct ValueType<T, F, false, false>
293 template<
typename T,
typename F,
bool HasCtor>
294 struct ValueType<T, F, HasCtor, true>
302 template<
typename T,
typename F>
303 struct ValueType<T, F, true, false>
311 template<
class From,
class To,
int N>
314 static inline int cast() {
return -1; }
317 template<
class From,
class To>
320 static inline int cast() {
return int(
reinterpret_cast<quintptr>(
static_cast<To *
>(
reinterpret_cast<From *
>(0x10000000)))) - 0x10000000; }
323 template<
class From,
class To>
334 return StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast();
340 template<
class T,
class A>
346 template<
class T,
class = std::
void_t<>,
bool OldStyle = QQmlTypeInfo<T>::hasAttachedProperties>
350 using Func = QQmlAttachedPropertiesFunc<QObject>;
357 struct QmlAttached<T,
std::void_t<typename OverridableAttachedType<T, typename T::QmlAttachedType>::Type>,
false>
360 template <
typename Parent,
typename Attached>
363 using Func = QQmlAttachedPropertiesFunc<Attached>;
369 template<
typename Parent>
370 struct Properties<Parent,
void>
372 using Func = QQmlAttachedPropertiesFunc<QObject>;
377 using Type =
typename std::conditional<
384 return Properties<T, Type>::staticMetaObject();
389 return Properties<T, Type>::attachedPropertiesFunc();
397 using Type =
typename std::remove_pointer<
decltype(T::qmlAttachedProperties(
nullptr))>
::type;
398 using Func = QQmlAttachedPropertiesFunc<Type>;
621 enum:
uint { InvalidStringId = (std::numeric_limits<uint>::max)() };
635 void setInstructionPointer(
int offset)
const;
636 void setReturnValueUndefined()
const;
640 bool captureQmlContextPropertyLookup(
uint index)
const;
641 void captureTranslation()
const;
642 QString translationContext()
const;
645 QJSValue javaScriptGlobalProperty(
uint nameIndex)
const;
655 int ctorIndex,
void *ctorArg)
const;
658 QDateTime constructDateTime(
double timestamp)
const;
663 ? constructDateTime(
arg.toString())
664 : constructDateTime(
arg.toDouble());
668 double year,
double month,
double day = 1,
669 double hours = 0,
double minutes = 0,
double seconds = 0,
double msecs = 0)
const;
690 bool callQmlContextPropertyLookup(
692 void initCallQmlContextPropertyLookup(
uint index)
const;
695 void initLoadContextIdLookup(
uint index)
const;
699 void initCallObjectPropertyLookup(
uint index)
const;
702 void initCallGlobalLookup(
uint index)
const;
705 void initLoadGlobalLookup(
uint index)
const;
708 bool writeBackScopeObjectPropertyLookup(
uint index,
void *
source)
const;
712 void initLoadSingletonLookup(
uint index,
uint importNamespace)
const;
718 void initLoadTypeLookup(
uint index,
uint importNamespace)
const;
729#if QT_QML_REMOVED_SINCE(6, 6)
733 const char *enumerator,
const char *enumValue)
const;
749#if QT_DEPRECATED_SINCE(6, 6)
783#if QT_DEPRECATED_SINCE(6, 3)
784 struct Q_QML_EXPORT SingletonFunctor
787 QPointer<QObject> m_object;
788 bool alreadyCalled =
false;
810 const int start = (startOffset == -1)
829 return (
index == -1) ? defaultValue
837 bool defaultValue =
false)
845 template<
class T,
class = std::
void_t<>>
854 using Type =
typename std::conditional<
856 typename T::QmlExtendedType,
void>
::type;
859 template<
class T,
class = std::
void_t<>>
871 return T::qmlExtendedNamespace();
877 template<
class T,
class = std::
void_t<>>
886 using Type =
typename std::conditional<
888 typename T::QmlForeignType, T>
::type;
891 template<
class T,
class = std::
void_t<>>
894 static constexpr bool Value =
false;
902 &&
bool(T::QmlIsUncreatable::yes);
905 template<
class T,
class = std::
void_t<>>
908 static constexpr bool Value =
false;
916 &&
bool(T::QmlIsAnonymous::yes);
920 template<
class T,
class = std::
void_t<>>
923 static constexpr bool Value =
false;
931 &&
bool(T::QmlIsSingleton::yes);
934 template<
class T,
class = std::
void_t<>>
937 static constexpr bool Value =
false;
945 static constexpr bool Value = bool(T::QmlIsSequence::yes);
948 template<
class T,
class = std::
void_t<>>
951 static constexpr bool Value =
false;
955 struct QmlInterface<T,
std::void_t<typename T::QmlIsInterface, decltype(qobject_interface_iid<T *>())>>
957 static constexpr bool Value = bool(T::QmlIsInterface::yes);
960 template<
class T,
typename = std::
void_t<>>
977 if constexpr (!std::is_default_constructible_v<T>)
979 else if constexpr (std::is_base_of_v<QObject, T>)
982 return std::is_copy_constructible_v<T>;
987 if constexpr (std::is_base_of_v<QObject, T>)
988 return QMetaType::fromType<T*>();
990 return QMetaType::fromType<T>();
995 if constexpr (std::is_base_of_v<QObject, T>)
998 return QMetaType::fromType<QList<T>>();
1003 if constexpr (std::is_base_of_v<QObject, T>)
1006 return QMetaSequence::fromContainer<QList<T>>();
1022 static constexpr int size() {
return 0; }
1025 template<
typename T,
typename E,
typename WrapperT = T>
1030 static_assert(std::is_base_of_v<QObject, T>);
1040 classInfoMetaObject,
1053 template<
typename T,
typename E>
1057 bool forceAnonymous =
false)
1072 classInfoMetaObject,
1074 attachedPropertiesFunc<T>(),
1075 attachedPropertiesMetaObject<T>(),
1084 &qmlCreateCustomParser<T>,
1098 template<
typename T>
1101 QVector<int> *qmlTypeIds)
1107 classInfoMetaObject,
1108 QMetaType::fromType<T>(),
1109 QMetaSequence::fromContainer<T>(),
1118 const char *uri,
int versionMajor,
const QMetaObject *classInfoMetaObject,
1119 QVector<int> *qmlTypeIds,
const QMetaObject *,
bool);
\inmodule QtCore\reentrant
The QJSEngine class provides an environment for evaluating JavaScript code.
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
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 QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static constexpr QTypeRevision fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
static constexpr QTypeRevision fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given value.
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 >
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)
QObject * createParent(QObject *p)
A *(*)(QObject *) QQmlAttachedPropertiesFunc
constexpr QtPrivate::QMetaTypeInterface metaTypeForNamespace(const QtPrivate::QMetaTypeInterface::MetaObjectFn &metaObjectFunction, const char *name)
void(*)(void *, void *) CreateIntoFunction
std::is_same< T, typename QmlMarkerFunction< Marker >::ClassType > QmlTypeHasMarker
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 *)
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)
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)
bool boolClassInfo(const QMetaObject *metaObject, const char *key, bool defaultValue=false)
QObject *(*)(QQmlEngine *, QJSEngine *) CreateSingletonFunction
int Q_QML_EXPORT qmlregister(RegistrationType, void *)
QVariant(*)(const QJSValue &) CreateValueTypeFunction
AutoParentResult(* AutoParentFunction)(QObject *object, QObject *parent)
Q_QML_EXPORT QMetaType compositeListMetaType(QV4::ExecutableCompilationUnit *unit, const QString &elementName)
Q_QML_EXPORT QMetaType compositeMetaType(QV4::ExecutableCompilationUnit *unit, const QString &elementName)
QObject *(*)(QObject *) CreateParentFunction
void qmlRegisterTypeAndRevisions< QQmlTypeNotAvailable, void >(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds, const QMetaObject *extension, bool)
Combined button and popup list for selecting options.
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
GLsizei GLsizei GLchar * source
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
QDebug warning(QAnyStringView fileName, int lineNumber)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QT_DEPRECATED_VERSION_X(major, minor, text)
QUrl url("example.com")
[constructor-url-reference]
obj metaObject() -> className()
QNetworkRequestFactory api
[0]
QQmlContextData * qmlContext
QDateTime constructDateTime(const QJSPrimitiveValue &arg) const
QV4::ExecutableCompilationUnit * compilationUnit
void(* functionPtr)(const AOTCompiledContext *context, void **argv)
void(* signature)(QV4::ExecutableCompilationUnit *unit, QMetaType *argTypes)
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
const QMetaObject * extensionMetaObject
QVector< int > * qmlTypeIds
std::function< QObject *(QQmlEngine *, QJSEngine *) qObjectApi)
std::function< QObject *(QQmlEngine *, QJSEngine *) qObjectApi)
const QMetaObject * extensionMetaObject
std::function< QJSValue(QQmlEngine *, QJSEngine *) scriptApi)
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)