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_isFinal =
false;
377 bool m_isConstant =
false;
410 QSharedPointer<const QQmlJSScope>
type()
const {
return m_type.toStrongRef(); }
412 void setAnnotations(
const QList<QQmlJSAnnotation> &annotation) { m_annotations = annotation; }
413 const QList<QQmlJSAnnotation> &
annotations()
const {
return m_annotations; }
438 int index()
const {
return m_index; }
444 return a.m_index ==
b.m_index &&
a.m_propertyName ==
b.m_propertyName
445 &&
a.m_typeName ==
b.m_typeName &&
a.m_bindable ==
b.m_bindable
446 &&
a.m_type.owner_equal(
b.m_type) &&
a.m_isList ==
b.m_isList
447 &&
a.m_isWritable ==
b.m_isWritable &&
a.m_isPointer ==
b.m_isPointer
448 &&
a.m_aliasExpr ==
b.m_aliasExpr &&
a.m_revision ==
b.m_revision
449 &&
a.m_isFinal ==
b.m_isFinal;
459 return qHashMulti(
seed, prop.m_propertyName, prop.m_typeName, prop.m_bindable,
461 prop.m_isPointer, prop.m_aliasExpr, prop.m_revision, prop.m_isFinal,
482 using Invalid = std::monostate;
515 return a.text ==
b.text &&
a.comment ==
b.comment &&
a.number ==
b.number &&
a.context ==
b.context;
526 return a.id ==
b.id &&
a.number ==
b.number;
535 return a.index ==
b.index &&
a.kind ==
b.kind;
547 QWeakPointer<const QQmlJSScope>
value;
552 return a.value.owner_equal(
b.value) &&
a.typeName ==
b.typeName;
556 QWeakPointer<const QQmlJSScope>
value;
561 return a.value.owner_equal(
b.value) &&
a.typeName ==
b.typeName;
565 QWeakPointer<const QQmlJSScope>
value;
590 return a.value.owner_equal(
b.value);
593 QWeakPointer<const QQmlJSScope>
value;
615 using type = std::variant<
Invalid, BoolLiteral, NumberLiteral, StringLiteral,
616 RegexpLiteral,
Null, TranslationString,
617 TranslationById, Script,
Object, Interceptor,
618 ValueSource, AttachedProperty, GroupProperty
621 using BindingContent = Content::type;
625 BindingContent m_bindingContent;
627 void ensureSetBindingTypeOnce()
629 Q_ASSERT(bindingType() == BindingType::Invalid);
632 bool isLiteralBinding()
const {
return isLiteralBinding(bindingType()); }
638 return type == BindingType::BoolLiteral ||
type == BindingType::NumberLiteral
639 ||
type == BindingType::StringLiteral ||
type == BindingType::RegExpLiteral
640 ||
type == BindingType::Null;
646 : m_sourceLocation(
location), m_propertyName(propName)
662 bool isValid()
const;
666 ensureSetBindingTypeOnce();
674 ensureSetBindingTypeOnce();
680 ensureSetBindingTypeOnce();
686 ensureSetBindingTypeOnce();
692 ensureSetBindingTypeOnce();
698 ensureSetBindingTypeOnce();
704 ensureSetBindingTypeOnce();
710 ensureSetBindingTypeOnce();
716 ensureSetBindingTypeOnce();
723 ensureSetBindingTypeOnce();
729 ensureSetBindingTypeOnce();
735 ensureSetBindingTypeOnce();
741 ensureSetBindingTypeOnce();
746 bool boolValue()
const;
748 double numberValue()
const;
756 QSharedPointer<const QQmlJSScope> literalType(
const QQmlJSTypeResolver *resolver)
const;
760 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
761 return script->index;
768 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
771 return ScriptBindingKind::Invalid;
776 if (
auto *script = std::get_if<Content::Script>(&m_bindingContent))
777 return script->valueType;
784 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
785 return object->typeName;
791 if (
auto *
object = std::get_if<Content::Object>(&m_bindingContent))
792 return object->value.lock();
799 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
800 return interceptor->typeName;
806 if (
auto *interceptor = std::get_if<Content::Interceptor>(&m_bindingContent))
807 return interceptor->value.lock();
814 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
815 return valueSource->typeName;
821 if (
auto *valueSource = std::get_if<Content::ValueSource>(&m_bindingContent))
822 return valueSource->value.lock();
829 if (
auto *
group = std::get_if<Content::GroupProperty>(&m_bindingContent))
830 return group->groupScope.lock();
837 if (
auto *attached = std::get_if<Content::AttachedProperty>(&m_bindingContent))
838 return attached->value.lock();
846 return isLiteralBinding();
848 bool hasObject()
const {
return bindingType() == BindingType::Object; }
851 return bindingType() == BindingType::Interceptor;
855 return bindingType() == BindingType::ValueSource;
860 return a.m_propertyName ==
b.m_propertyName
861 &&
a.m_bindingContent ==
b.m_bindingContent
862 &&
a.m_sourceLocation ==
b.m_sourceLocation;
873 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)