4#ifndef QQMLJSMETATYPES_P_H
5#define QQMLJSMETATYPES_P_H
17#include <qtqmlcompilerexports.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>
60 QSharedPointer<const QQmlJSScope> m_type;
61 bool m_isFlag =
false;
62 bool m_isScoped =
false;
77 bool isFlag()
const {
return m_isFlag; }
83 bool isQml()
const {
return m_isQml; }
90 QList<int>
values()
const {
return m_values; }
92 bool hasValues()
const {
return !m_values.isEmpty(); }
99 QSharedPointer<const QQmlJSScope>
type()
const {
return m_type; }
104 return a.m_keys ==
b.m_keys
105 &&
a.m_values ==
b.m_values
106 &&
a.m_name ==
b.m_name
107 &&
a.m_alias ==
b.m_alias
108 &&
a.m_isFlag ==
b.m_isFlag
109 &&
a.m_type ==
b.m_type
110 &&
a.m_isScoped ==
b.m_isScoped;
121 seed, e.m_keys, e.m_values, e.m_name, e.m_alias, e.m_isFlag, e.m_type, e.m_isScoped);
141 QWeakPointer<const QQmlJSScope>
type = {})
164 return a.m_name ==
b.m_name &&
a.m_typeName ==
b.m_typeName
165 &&
a.m_type.owner_equal(
b.m_type)
166 &&
a.m_typeQualifier ==
b.m_typeQualifier;
183 QWeakPointer<const QQmlJSScope> m_type;
185 bool m_isPointer =
false;
186 bool m_isList =
false;
231 QSharedPointer<const QQmlJSScope>
returnType()
const {
return m_returnType.
type(); }
234 QList<QQmlJSMetaParameter>
parameters()
const {
return m_parameters; }
238 return { m_parameters.
begin(), m_parameters.
end() };
244 for (
const auto &
p : m_parameters)
277 m_isImplicitQmlPropertyChangeSignal = isPropertyChangeSignal;
282 const QVector<QQmlJSAnnotation>&
annotations()
const {
return m_annotations; }
288 m_relativeFunctionIndex =
index;
294 return m_relativeFunctionIndex;
300 m_relativeFunctionIndex =
index;
306 return m_relativeFunctionIndex;
311 return a.m_name ==
b.m_name &&
a.m_returnType ==
b.m_returnType
312 &&
a.m_parameters ==
b.m_parameters &&
a.m_annotations ==
b.m_annotations
313 &&
a.m_methodType ==
b.m_methodType &&
a.m_methodAccess ==
b.m_methodAccess
314 &&
a.m_revision ==
b.m_revision &&
a.m_isConstructor ==
b.m_isConstructor;
334 for (
const auto &
type :
method.m_parameters) {
347 QList<QQmlJSMetaParameter> m_parameters;
348 QList<QQmlJSAnnotation> m_annotations;
354 bool m_isCloned =
false;
355 bool m_isConstructor =
false;
356 bool m_isJavaScriptFunction =
false;
357 bool m_isImplicitQmlPropertyChangeSignal =
false;
371 QWeakPointer<const QQmlJSScope> m_type;
372 QVector<QQmlJSAnnotation> m_annotations;
373 bool m_isList =
false;
374 bool m_isWritable =
false;
375 bool m_isPointer =
false;
376 bool m_isTypeConstant =
false;
377 bool m_isFinal =
false;
378 bool m_isPropertyConstant =
false;
411 QSharedPointer<const QQmlJSScope>
type()
const {
return m_type.toStrongRef(); }
413 void setAnnotations(
const QList<QQmlJSAnnotation> &annotation) { m_annotations = annotation; }
414 const QList<QQmlJSAnnotation> &
annotations()
const {
return m_annotations; }
442 int index()
const {
return m_index; }
448 return a.m_index ==
b.m_index &&
a.m_propertyName ==
b.m_propertyName
449 &&
a.m_typeName ==
b.m_typeName &&
a.m_bindable ==
b.m_bindable
450 &&
a.m_type.owner_equal(
b.m_type) &&
a.m_isList ==
b.m_isList
451 &&
a.m_isWritable ==
b.m_isWritable &&
a.m_isPointer ==
b.m_isPointer
452 &&
a.m_aliasExpr ==
b.m_aliasExpr &&
a.m_revision ==
b.m_revision
453 &&
a.m_isFinal ==
b.m_isFinal;
463 return qHashMulti(
seed, prop.m_propertyName, prop.m_typeName, prop.m_bindable,
465 prop.m_isPointer, prop.m_aliasExpr, prop.m_revision, prop.m_isFinal,
486 using Invalid = std::monostate;
519 return a.text ==
b.text &&
a.comment ==
b.comment &&
a.number ==
b.number &&
a.context ==
b.context;
530 return a.id ==
b.id &&
a.number ==
b.number;
539 return a.index ==
b.index &&
a.kind ==
b.kind;
551 QWeakPointer<const QQmlJSScope>
value;
556 return a.value.owner_equal(
b.value) &&
a.typeName ==
b.typeName;
560 QWeakPointer<const QQmlJSScope>
value;
565 return a.value.owner_equal(
b.value) &&
a.typeName ==
b.typeName;
569 QWeakPointer<const QQmlJSScope>
value;
594 return a.value.owner_equal(
b.value);
597 QWeakPointer<const QQmlJSScope>
value;
619 using type = std::variant<
Invalid, BoolLiteral, NumberLiteral, StringLiteral,
620 RegexpLiteral,
Null, TranslationString,
621 TranslationById, Script,
Object, Interceptor,
622 ValueSource, AttachedProperty, GroupProperty
625 using BindingContent = Content::type;
629 BindingContent m_bindingContent;
631 void ensureSetBindingTypeOnce()
633 Q_ASSERT(bindingType() == BindingType::Invalid);
636 bool isLiteralBinding()
const {
return isLiteralBinding(bindingType()); }
642 return type == BindingType::BoolLiteral ||
type == BindingType::NumberLiteral
643 ||
type == BindingType::StringLiteral ||
type == BindingType::RegExpLiteral
644 ||
type == BindingType::Null;
650 : m_sourceLocation(
location), m_propertyName(propName)
666 bool isValid()
const;
670 ensureSetBindingTypeOnce();
678 ensureSetBindingTypeOnce();
684 ensureSetBindingTypeOnce();
690 ensureSetBindingTypeOnce();
696 ensureSetBindingTypeOnce();
702 ensureSetBindingTypeOnce();
708 ensureSetBindingTypeOnce();
714 ensureSetBindingTypeOnce();
720 ensureSetBindingTypeOnce();
727 ensureSetBindingTypeOnce();
733 ensureSetBindingTypeOnce();
739 ensureSetBindingTypeOnce();
745 ensureSetBindingTypeOnce();
750 bool boolValue()
const;
752 double numberValue()
const;
760 QSharedPointer<const QQmlJSScope> literalType(
const QQmlJSTypeResolver *resolver)
const;
764 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
765 return script->index;
772 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
775 return ScriptBindingKind::Invalid;
780 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
781 return script->valueType;
788 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
789 return object->typeName;
795 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
796 return object->value.lock();
803 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
804 return interceptor->typeName;
810 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
811 return interceptor->value.lock();
818 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
819 return valueSource->typeName;
825 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
826 return valueSource->value.lock();
833 if (
auto *
group = std::get_if<Content::GroupProperty>(&m_bindingContent))
834 return group->groupScope.lock();
841 if (
auto *attached = std::get_if<Content::AttachedProperty>(&m_bindingContent))
842 return attached->value.lock();
850 return isLiteralBinding();
852 bool hasObject()
const {
return bindingType() == BindingType::Object; }
855 return bindingType() == BindingType::Interceptor;
859 return bindingType() == BindingType::ValueSource;
864 return a.m_propertyName ==
b.m_propertyName
865 &&
a.m_bindingContent ==
b.m_bindingContent
866 &&
a.m_sourceLocation ==
b.m_sourceLocation;
877 return qHashMulti(
seed, binding.m_propertyName, binding.m_sourceLocation,
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 noexcept
Returns true if the string has no characters; otherwise returns false.
size_t owner_hash() const noexcept
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)