4#ifndef QQMLJSMETATYPES_P_H
5#define QQMLJSMETATYPES_P_H
17#include <private/qtqmlcompilerexports_p.h>
19#include <QtCore/qstring.h>
20#include <QtCore/qstringlist.h>
21#include <QtCore/qsharedpointer.h>
22#include <QtCore/qvariant.h>
23#include <QtCore/qhash.h>
25#include <QtQml/private/qqmljssourcelocation_p.h>
26#include <QtQml/private/qqmltranslation_p.h>
61 bool m_isFlag =
false;
76 bool isFlag()
const {
return m_isFlag; }
100 return a.m_keys ==
b.m_keys
101 &&
a.m_values ==
b.m_values
102 &&
a.m_name ==
b.m_name
103 &&
a.m_alias ==
b.m_alias
104 &&
a.m_isFlag ==
b.m_isFlag
105 &&
a.m_type ==
b.m_type;
155 return a.m_name ==
b.m_name &&
a.m_typeName ==
b.m_typeName
156 &&
a.m_type.toStrongRef().data() ==
b.m_type.toStrongRef().data()
157 &&
a.m_typeQualifier ==
b.m_typeQualifier;
176 bool m_isPointer =
false;
177 bool m_isList =
false;
226 for (
const auto &
p : m_parameters)
259 m_isImplicitQmlPropertyChangeSignal = isPropertyChangeSignal;
270 m_relativeFunctionIndex =
index;
276 return m_relativeFunctionIndex;
282 m_relativeFunctionIndex =
index;
288 return m_relativeFunctionIndex;
293 return a.m_name ==
b.m_name &&
a.m_returnTypeName ==
b.m_returnTypeName
294 &&
a.m_returnType ==
b.m_returnType &&
a.m_parameters ==
b.m_parameters
295 &&
a.m_annotations ==
b.m_annotations &&
a.m_methodType ==
b.m_methodType
296 &&
a.m_methodAccess ==
b.m_methodAccess &&
a.m_revision ==
b.m_revision
297 &&
a.m_isConstructor ==
b.m_isConstructor;
318 for (
const auto &
type :
method.m_parameters) {
337 bool m_isCloned =
false;
338 bool m_isConstructor =
false;
339 bool m_isJavaScriptFunction =
false;
340 bool m_isImplicitQmlPropertyChangeSignal =
false;
356 bool m_isList =
false;
357 bool m_isWritable =
false;
358 bool m_isPointer =
false;
359 bool m_isFinal =
false;
360 bool m_isConstant =
false;
421 int index()
const {
return m_index; }
427 return a.m_index ==
b.m_index &&
a.m_propertyName ==
b.m_propertyName
428 &&
a.m_typeName ==
b.m_typeName &&
a.m_bindable ==
b.m_bindable
429 &&
a.m_type ==
b.m_type &&
a.m_isList ==
b.m_isList
430 &&
a.m_isWritable ==
b.m_isWritable &&
a.m_isPointer ==
b.m_isPointer
431 &&
a.m_aliasExpr ==
b.m_aliasExpr &&
a.m_revision ==
b.m_revision
432 &&
a.m_isFinal ==
b.m_isFinal;
442 return qHashMulti(
seed, prop.m_propertyName, prop.m_typeName, prop.m_bindable,
444 prop.m_isPointer, prop.m_aliasExpr, prop.m_revision, prop.m_isFinal,
465 using Invalid = std::monostate;
498 return a.text ==
b.text &&
a.comment ==
b.comment &&
a.number ==
b.number &&
a.context ==
b.context;
509 return a.id ==
b.id &&
a.number ==
b.number;
518 return a.index ==
b.index &&
a.kind ==
b.kind;
535 return a.value ==
b.value &&
a.typeName ==
b.typeName;
544 return a.value ==
b.value &&
a.typeName ==
b.typeName;
573 return a.value ==
b.value;
598 using type = std::variant<
Invalid, BoolLiteral, NumberLiteral, StringLiteral,
599 RegexpLiteral,
Null, TranslationString,
600 TranslationById, Script,
Object, Interceptor,
601 ValueSource, AttachedProperty, GroupProperty
604 using BindingContent = Content::type;
608 BindingContent m_bindingContent;
610 void ensureSetBindingTypeOnce()
612 Q_ASSERT(bindingType() == BindingType::Invalid);
615 bool isLiteralBinding()
const {
return isLiteralBinding(bindingType()); }
621 return type == BindingType::BoolLiteral ||
type == BindingType::NumberLiteral
622 ||
type == BindingType::StringLiteral ||
type == BindingType::RegExpLiteral
623 ||
type == BindingType::Null;
629 : m_sourceLocation(
location), m_propertyName(propName)
645 bool isValid()
const;
649 ensureSetBindingTypeOnce();
657 ensureSetBindingTypeOnce();
663 ensureSetBindingTypeOnce();
669 ensureSetBindingTypeOnce();
675 ensureSetBindingTypeOnce();
681 ensureSetBindingTypeOnce();
687 ensureSetBindingTypeOnce();
693 ensureSetBindingTypeOnce();
699 ensureSetBindingTypeOnce();
706 ensureSetBindingTypeOnce();
712 ensureSetBindingTypeOnce();
718 ensureSetBindingTypeOnce();
724 ensureSetBindingTypeOnce();
728 QString literalTypeName()
const;
731 bool boolValue()
const;
733 double numberValue()
const;
745 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
746 return script->index;
753 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
756 return ScriptBindingKind::Script_Invalid;
761 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
762 return script->valueType;
769 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
770 return object->typeName;
776 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
777 return object->value.lock();
784 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
785 return interceptor->typeName;
791 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
792 return interceptor->value.lock();
799 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
800 return valueSource->typeName;
806 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
807 return valueSource->value.lock();
814 if (
auto *
group = std::get_if<Content::GroupProperty>(&m_bindingContent))
815 return group->groupScope.lock();
822 if (
auto *attached = std::get_if<Content::AttachedProperty>(&m_bindingContent))
823 return attached->value.lock();
831 return isLiteralBinding();
833 bool hasObject()
const {
return bindingType() == BindingType::Object; }
836 return bindingType() == BindingType::Interceptor;
840 return bindingType() == BindingType::ValueSource;
845 return a.m_propertyName ==
b.m_propertyName
846 &&
a.m_bindingContent ==
b.m_bindingContent
847 &&
a.m_sourceLocation ==
b.m_sourceLocation;
858 return qHashMulti(
seed, binding.m_propertyName, binding.m_sourceLocation,
bool isEmpty() const noexcept
T value(qsizetype i) const
void append(parameter_type t)
Tracks the types for the QmlCompiler.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
QString toString() const
Returns a deep copy of this string view's data as a QString.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QSharedPointer< T > toStrongRef() const
Promotes this weak reference to a strong one and returns a QSharedPointer object holding that referen...
Combined button and popup list for selecting options.
#define QT_WARNING_DISABLE_GCC(text)
#define QT_WARNING_DISABLE_CLANG(text)
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 * method
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr QtPrivate::QHashMultiReturnType< T... > qHashMulti(size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QStringLiteral(str)
friend bool operator!=(AttachedProperty a, AttachedProperty b)
friend bool operator==(AttachedProperty a, AttachedProperty b)
QWeakPointer< const QQmlJSScope > value
friend bool operator==(BoolLiteral a, BoolLiteral b)
friend bool operator!=(BoolLiteral a, BoolLiteral b)
friend bool operator!=(GroupProperty a, GroupProperty b)
QWeakPointer< const QQmlJSScope > groupScope
friend bool operator==(GroupProperty a, GroupProperty b)
friend bool operator==(Interceptor a, Interceptor b)
QWeakPointer< const QQmlJSScope > value
friend bool operator!=(Interceptor a, Interceptor b)
friend bool operator!=(Null a, Null b)
friend bool operator==(Null, Null)
QT_WARNING_POP double value
friend bool operator!=(NumberLiteral a, NumberLiteral b)
QWeakPointer< const QQmlJSScope > value
friend bool operator!=(Object a, Object b)
friend bool operator==(Object a, Object b)
friend bool operator!=(RegexpLiteral a, RegexpLiteral b)
friend bool operator==(RegexpLiteral a, RegexpLiteral b)
friend bool operator==(Script a, Script b)
friend bool operator!=(Script a, Script b)
friend bool operator==(StringLiteral a, StringLiteral b)
friend bool operator!=(StringLiteral a, StringLiteral b)
friend bool operator!=(TranslationById a, TranslationById b)
friend bool operator==(TranslationById a, TranslationById b)
friend bool operator==(TranslationString a, TranslationString b)
friend bool operator!=(TranslationString a, TranslationString b)
QWeakPointer< const QQmlJSScope > value
friend bool operator!=(ValueSource a, ValueSource b)
friend bool operator==(ValueSource a, ValueSource b)