Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmlirbuilder_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QQMLIRBUILDER_P_H
4#define QQMLIRBUILDER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <private/qqmljsast_p.h>
18#include <private/qqmljsengine_p.h>
19#include <private/qv4compiler_p.h>
20#include <private/qv4compileddata_p.h>
21#include <private/qqmljsmemorypool_p.h>
22#include <private/qqmljsfixedpoolarray_p.h>
23#include <private/qv4codegen_p.h>
24#include <private/qv4compiler_p.h>
25#include <QTextStream>
26#include <QCoreApplication>
27
29
31class QQmlContextData;
33struct QQmlIRLoader;
34
35namespace QmlIR {
36
37struct Document;
38
39template <typename T>
41{
43 : first(nullptr)
44 , last(nullptr)
45 {}
46
48 T *last;
49 int count = 0;
50
51 int append(T *item) {
52 item->next = nullptr;
53 if (last)
54 last->next = item;
55 else
56 first = item;
57 last = item;
58 return count++;
59 }
60
61 void prepend(T *item) {
62 item->next = first;
63 first = item;
64 if (!last)
65 last = first;
66 ++count;
67 }
68
69 template <typename Sortable, typename Base, Sortable Base::*sortMember>
71 {
72 T *insertPos = nullptr;
73
74 for (T *it = first; it; it = it->next) {
75 if (!(it->*sortMember <= item->*sortMember))
76 break;
77 insertPos = it;
78 }
79
80 return insertPos;
81 }
82
83 void insertAfter(T *insertionPoint, T *item) {
84 if (!insertionPoint) {
86 } else if (insertionPoint == last) {
87 append(item);
88 } else {
89 item->next = insertionPoint->next;
90 insertionPoint->next = item;
91 ++count;
92 }
93 }
94
95 T *unlink(T *before, T *item) {
96 T * const newNext = item->next;
97
98 if (before)
99 before->next = newNext;
100 else
101 first = newNext;
102
103 if (item == last) {
104 if (newNext)
105 last = newNext;
106 else
107 last = first;
108 }
109
110 --count;
111 return newNext;
112 }
113
114 T *slowAt(int index) const
115 {
116 T *result = first;
117 while (index > 0 && result) {
118 result = result->next;
119 --index;
120 }
121 return result;
122 }
123
124 struct Iterator {
125 // turn Iterator into a proper iterator
126 using iterator_category = std::forward_iterator_tag;
127 using value_type = T;
128 using difference_type = ptrdiff_t;
129 using pointer = T *;
130 using reference = T &;
131
132 T *ptr;
133
134 explicit Iterator(T *p) : ptr(p) {}
135
137 return ptr;
138 }
139
140 const T *operator->() const {
141 return ptr;
142 }
143
145 return *ptr;
146 }
147
148 const T &operator*() const {
149 return *ptr;
150 }
151
153 ptr = ptr->next;
154 return *this;
155 }
156
158 Iterator that {ptr};
159 ptr = ptr->next;
160 return that;
161 }
162
163 bool operator==(const Iterator &rhs) const {
164 return ptr == rhs.ptr;
165 }
166
167 bool operator!=(const Iterator &rhs) const {
168 return ptr != rhs.ptr;
169 }
170
171 operator T *() { return ptr; }
172 operator const T *() const { return ptr; }
173 };
174
176 Iterator end() { return Iterator(nullptr); }
177
179};
180
181struct Object;
182
184{
186};
187
188struct Enum
189{
193
194 int enumValueCount() const { return enumValues->count; }
197
199};
200
201
203{
205
206 template<typename IdGenerator>
207 static bool initType(
208 QV4::CompiledData::ParameterType *type, const IdGenerator &idGenerator,
209 const QQmlJS::AST::Type *annotation)
210 {
212
213 if (!annotation)
214 return initType(type, QString(), idGenerator(QString()), Flag::NoFlag);
215
216 const QString typeId = annotation->typeId->toString();
217 const QString typeArgument =
218 annotation->typeArgument ? annotation->typeArgument->toString() : QString();
219
220 if (typeArgument.isEmpty())
221 return initType(type, typeId, idGenerator(typeId), Flag::NoFlag);
222
223 if (typeId == QLatin1String("list"))
224 return initType(type, typeArgument, idGenerator(typeArgument), Flag::List);
225
226 const QString annotationString = annotation->toString();
227 return initType(type, annotationString, idGenerator(annotationString), Flag::NoFlag);
228 }
229
231
232private:
233 static bool initType(
235 int typeNameIndex, QV4::CompiledData::ParameterType::Flag listFlag);
236};
237
238struct Signal
239{
243
245
246 int parameterCount() const { return parameters->count; }
249
251};
252
254{
256};
257
259{
260 // The offset in the source file where the binding appeared. This is used for sorting to ensure
261 // that assignments to list properties are done in the correct order. We use the offset here instead
262 // of Binding::location as the latter has limited precision.
264 // Binding's compiledScriptIndex is index in object's functionsAndExpressions
266};
267
269{
271};
272
274{
276};
277
279{
281};
282
284{
287 quint32 index; // index in parsedQML::functions
290
291 // --- QQmlPropertyCacheCreator interface
292 const Parameter *formalsBegin() const { return formals.begin(); }
293 const Parameter *formalsEnd() const { return formals.end(); }
294 // ---
295
297};
298
300{
302 {}
303
304 QQmlJS::AST::Node *parentNode = nullptr; // FunctionDeclaration, Statement or Expression
305 QQmlJS::AST::Node *node = nullptr; // FunctionDeclaration, Statement or Expression
306 quint32 nameIndex = 0;
308};
309
311{
313public:
316 int id;
320
323
324 const Property *firstProperty() const { return properties->first; }
325 int propertyCount() const { return properties->count; }
326 Alias *firstAlias() const { return aliases->first; }
327 int aliasCount() const { return aliases->count; }
328 const Enum *firstEnum() const { return qmlEnums->first; }
329 int enumCount() const { return qmlEnums->count; }
330 const Signal *firstSignal() const { return qmlSignals->first; }
331 int signalCount() const { return qmlSignals->count; }
332 Binding *firstBinding() const { return bindings->first; }
333 int bindingCount() const { return bindings->count; }
334 const Function *firstFunction() const { return functions->first; }
335 int functionCount() const { return functions->count; }
336 const InlineComponent *inlineComponent() const { return inlineComponents->first; }
337 int inlineComponentCount() const { return inlineComponents->count; }
338 const RequiredPropertyExtraData *requiredPropertyExtraData() const {return requiredPropertyExtraDatas->first; }
339 int requiredPropertyExtraDataCount() const { return requiredPropertyExtraDatas->count; }
340 void simplifyRequiredProperties();
341
342 PoolList<Binding>::Iterator bindingsBegin() const { return bindings->begin(); }
343 PoolList<Binding>::Iterator bindingsEnd() const { return bindings->end(); }
346 PoolList<Alias>::Iterator aliasesBegin() const { return aliases->begin(); }
347 PoolList<Alias>::Iterator aliasesEnd() const { return aliases->end(); }
348 PoolList<Enum>::Iterator enumsBegin() const { return qmlEnums->begin(); }
349 PoolList<Enum>::Iterator enumsEnd() const { return qmlEnums->end(); }
350 PoolList<Signal>::Iterator signalsBegin() const { return qmlSignals->begin(); }
351 PoolList<Signal>::Iterator signalsEnd() const { return qmlSignals->end(); }
352 PoolList<Function>::Iterator functionsBegin() const { return functions->begin(); }
353 PoolList<Function>::Iterator functionsEnd() const { return functions->end(); }
354 PoolList<InlineComponent>::Iterator inlineComponentsBegin() const { return inlineComponents->begin(); }
355 PoolList<InlineComponent>::Iterator inlineComponentsEnd() const { return inlineComponents->end(); }
356 PoolList<RequiredPropertyExtraData>::Iterator requiredPropertyExtraDataBegin() const {return requiredPropertyExtraDatas->begin(); }
357 PoolList<RequiredPropertyExtraData>::Iterator requiredPropertyExtraDataEnd() const {return requiredPropertyExtraDatas->end(); }
358
359 // If set, then declarations for this object (and init bindings for these) should go into the
360 // specified object. Used for declarations inside group properties.
362
363 void init(QQmlJS::MemoryPool *pool, int typeNameIndex, int idIndex, const QV4::CompiledData::Location &location);
364
365 QString appendEnum(Enum *enumeration);
366 QString appendSignal(Signal *signal);
367 QString appendProperty(Property *prop, const QString &propertyName, bool isDefaultProperty, const QQmlJS::SourceLocation &defaultToken, QQmlJS::SourceLocation *errorLocation);
368 QString appendAlias(Alias *prop, const QString &aliasName, bool isDefaultProperty, const QQmlJS::SourceLocation &defaultToken, QQmlJS::SourceLocation *errorLocation);
369 void appendFunction(QmlIR::Function *f);
370 void appendInlineComponent(InlineComponent *ic);
371 void appendRequiredPropertyExtraData(RequiredPropertyExtraData *extraData);
372
373 QString appendBinding(Binding *b, bool isListBinding);
374 Binding *findBinding(quint32 nameIndex) const;
375 Binding *unlinkBinding(Binding *before, Binding *binding) { return bindings->unlink(before, binding); }
376 void insertSorted(Binding *b);
377 QString bindingAsString(Document *doc, int scriptIndex) const;
378
381
383 int namedObjectsInComponentCount() const { return namedObjectsInComponent.size(); }
384 const quint32 *namedObjectsInComponentTable() const { return namedObjectsInComponent.begin(); }
385
386 bool hasFlag(QV4::CompiledData::Object::Flag flag) const { return flags & flag; }
387 qint32 objectId() const { return id; }
388 bool hasAliasAsDefaultProperty() const { return defaultPropertyIsAlias; }
389
390private:
391 friend struct ::QQmlIRLoader;
392
394 PoolList<Alias> *aliases;
395 PoolList<Enum> *qmlEnums;
396 PoolList<Signal> *qmlSignals;
397 PoolList<Binding> *bindings;
398 PoolList<Function> *functions;
399 PoolList<InlineComponent> *inlineComponents;
400 PoolList<RequiredPropertyExtraData> *requiredPropertyExtraDatas;
401};
402
404{
406 {
414 };
415
417 {
421 };
422
424 {
426 Bound
427 };
428
430 {
432 Enforced
433 };
434
436 {
438 RejectThisObject
439 };
440
442 {
443 Copy = 0x1,
444 Addressable = 0x2,
445 };
446 Q_DECLARE_FLAGS(ValueTypeBehaviorValues, ValueTypeBehaviorValue);
447
449
450 union {
455 ValueTypeBehaviorValues::Int valueTypeBehavior;
456 };
457
459};
460
462{
463 Document(bool debugMode);
472
474
475 bool isSingleton() const {
476 return std::any_of(pragmas.constBegin(), pragmas.constEnd(), [](const Pragma *pragma) {
477 return pragma->type == Pragma::Singleton;
478 });
479 }
480
481 int registerString(const QString &str) { return jsGenerator.registerString(str); }
482 QString stringAt(int index) const { return jsGenerator.stringForIndex(index); }
483
484 int objectCount() const {return objects.size();}
485 Object* objectAt(int i) const {return objects.at(i);}
486};
487
489{
490 QmlIR::Document *document;
493
494public:
496
497 void pragmaLibrary() override;
498 void importFile(const QString &jsfile, const QString &module, int lineNumber, int column) override;
499 void importModule(const QString &uri, const QString &version, const QString &module, int lineNumber, int column) override;
500};
501
503{
504 Q_DECLARE_TR_FUNCTIONS(QQmlCodeGenerator)
505public:
506 IRBuilder(const QSet<QString> &illegalNames);
507 bool generateFromQml(const QString &code, const QString &url, Document *output);
508
509 static bool isSignalPropertyName(const QString &name);
510 static QString signalNameFromSignalPropertyName(const QString &signalPropertyName);
511
512 using QQmlJS::AST::Visitor::visit;
513 using QQmlJS::AST::Visitor::endVisit;
514
515 bool visit(QQmlJS::AST::UiArrayMemberList *ast) override;
516 bool visit(QQmlJS::AST::UiImport *ast) override;
517 bool visit(QQmlJS::AST::UiPragma *ast) override;
518 bool visit(QQmlJS::AST::UiHeaderItemList *ast) override;
519 bool visit(QQmlJS::AST::UiObjectInitializer *ast) override;
520 bool visit(QQmlJS::AST::UiObjectMemberList *ast) override;
521 bool visit(QQmlJS::AST::UiParameterList *ast) override;
522 bool visit(QQmlJS::AST::UiProgram *) override;
523 bool visit(QQmlJS::AST::UiQualifiedId *ast) override;
524 bool visit(QQmlJS::AST::UiArrayBinding *ast) override;
525 bool visit(QQmlJS::AST::UiObjectBinding *ast) override;
526 bool visit(QQmlJS::AST::UiObjectDefinition *ast) override;
527 bool visit(QQmlJS::AST::UiInlineComponent *ast) override;
528 bool visit(QQmlJS::AST::UiEnumDeclaration *ast) override;
529 bool visit(QQmlJS::AST::UiPublicMember *ast) override;
530 bool visit(QQmlJS::AST::UiScriptBinding *ast) override;
531 bool visit(QQmlJS::AST::UiSourceElement *ast) override;
532 bool visit(QQmlJS::AST::UiRequired *ast) override;
533
535 {
536 recordError(QQmlJS::SourceLocation(),
537 QStringLiteral("Maximum statement or expression depth exceeded"));
538 }
539
540 void accept(QQmlJS::AST::Node *node);
541
542 // returns index in _objects
543 bool defineQMLObject(
544 int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId,
546 QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = nullptr);
547
549 int *objectIndex, QQmlJS::AST::UiObjectDefinition *node,
550 Object *declarationsOverride = nullptr)
551 {
553 return defineQMLObject(
554 objectIndex, node->qualifiedTypeNameId,
555 { location.startLine, location.startColumn }, node->initializer,
556 declarationsOverride);
557 }
558
559 static QString asString(QQmlJS::AST::UiQualifiedId *node);
560 QStringView asStringRef(QQmlJS::AST::Node *node);
561 static QTypeRevision extractVersion(QStringView string);
563 { return QStringView(sourceCode).mid(loc.offset, loc.length); }
565 const QQmlJS::SourceLocation &last) const;
566
567 void setBindingValue(QV4::CompiledData::Binding *binding, QQmlJS::AST::Statement *statement,
568 QQmlJS::AST::Node *parentNode);
569 void tryGeneratingTranslationBinding(QStringView base, QQmlJS::AST::ArgumentList *args, QV4::CompiledData::Binding *binding);
570
572 QQmlJS::AST::Node *parentNode);
573 void appendBinding(QQmlJS::AST::UiQualifiedId *name, int objectIndex, bool isOnAssignment = false);
574 void appendBinding(const QQmlJS::SourceLocation &qualifiedNameLocation,
575 const QQmlJS::SourceLocation &nameLocation, quint32 propertyNameIndex,
577 void appendBinding(const QQmlJS::SourceLocation &qualifiedNameLocation,
578 const QQmlJS::SourceLocation &nameLocation, quint32 propertyNameIndex,
579 int objectIndex, bool isListItem = false, bool isOnAssignment = false);
580
581 bool appendAlias(QQmlJS::AST::UiPublicMember *node);
582
583 Object *bindingsTarget() const;
584
586
587 // resolves qualified name (font.pixelSize for example) and returns the last name along
588 // with the object any right-hand-side of a binding should apply to.
589 bool resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, Object **object, bool onAssignment = false);
590
591 void recordError(const QQmlJS::SourceLocation &location, const QString &description);
592
593 quint32 registerString(const QString &str) const { return jsGenerator->registerString(str); }
594 template <typename _Tp> _Tp *New() { return pool->New<_Tp>(); }
595
596 QString stringAt(int index) const { return jsGenerator->stringForIndex(index); }
597
598 static bool isStatementNodeScript(QQmlJS::AST::Statement *statement);
599 static bool isRedundantNullInitializerForPropertyDeclaration(Property *property, QQmlJS::AST::Statement *statement);
600
601 QString sanityCheckFunctionNames(Object *obj, const QSet<QString> &illegalNames, QQmlJS::SourceLocation *errorLocation);
602
604
607
611
613
616
620
621 bool insideInlineComponent = false;
622};
623
625{
627
628private:
629 typedef bool (Binding::*BindingFilter)() const;
630 char *writeBindings(char *bindingPtr, const Object *o, BindingFilter filter) const;
631};
632
634{
635 JSCodeGen(Document *document, const QSet<QString> &globalNames,
638 bool storeSourceLocations = false);
639
640 // Returns mapping from input functions to index in IR::Module::functions / compiledData->runtimeFunctions
642 generateJSCodeForFunctionsAndBindings(const QList<CompiledFunctionOrExpression> &functions);
643
644 bool generateRuntimeFunctions(QmlIR::Object *object);
645
646private:
647 Document *document;
648};
649
650// RegisterStringN ~= std::function<int(QStringView)>
651// FinalizeTranlationData ~= std::function<void(QV4::CompiledData::Binding::ValueType, QV4::CompiledData::TranslationData)>
652/*
653 \internal
654 \a base: name of the potential translation function
655 \a args: arguments to the function call
656 \a registerMainString: Takes the first argument passed to the translation function, and it's
657 result will be stored in a TranslationData's stringIndex for translation bindings and in numbeIndex
658 for string bindings.
659 \a registerCommentString: Takes the comment argument passed to some of the translation functions.
660 Result will be stored in a TranslationData's commentIndex
661 \a finalizeTranslationData: Takes the type of the binding and the previously set up TranslationData
662 */
663template<
664 typename RegisterMainString,
665 typename RegisterCommentString,
666 typename RegisterContextString,
667 typename FinalizeTranslationData>
669 RegisterMainString registerMainString,
670 RegisterCommentString registerCommentString,
671 RegisterContextString registerContextString,
672 FinalizeTranslationData finalizeTranslationData
673 )
674{
675 if (base == QLatin1String("qsTr")) {
677 translationData.number = -1;
678 translationData.commentIndex = 0; // empty string
679 translationData.contextIndex = 0;
680
681 if (!args || !args->expression)
682 return; // no arguments, stop
683
684 QStringView translation;
685 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
686 translation = arg1->value;
687 } else {
688 return; // first argument is not a string, stop
689 }
690
691 translationData.stringIndex = registerMainString(translation);
692
693 args = args->next;
694
695 if (args) {
696 QQmlJS::AST::StringLiteral *arg2 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
697 if (!arg2)
698 return; // second argument is not a string, stop
699 translationData.commentIndex = registerCommentString(arg2->value);
700
701 args = args->next;
702 if (args) {
703 if (QQmlJS::AST::NumericLiteral *arg3 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
704 translationData.number = int(arg3->value);
705 args = args->next;
706 } else {
707 return; // third argument is not a translation number, stop
708 }
709 }
710 }
711
712 if (args)
713 return; // too many arguments, stop
714
715 finalizeTranslationData(QV4::CompiledData::Binding::Type_Translation, translationData);
716 } else if (base == QLatin1String("qsTrId")) {
718 translationData.number = -1;
719 translationData.commentIndex = 0; // empty string, but unused
720 translationData.contextIndex = 0;
721
722 if (!args || !args->expression)
723 return; // no arguments, stop
724
726 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
727 id = arg1->value;
728 } else {
729 return; // first argument is not a string, stop
730 }
731 translationData.stringIndex = registerMainString(id);
732
733 args = args->next;
734
735 if (args) {
736 if (QQmlJS::AST::NumericLiteral *arg3 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
737 translationData.number = int(arg3->value);
738 args = args->next;
739 } else {
740 return; // third argument is not a translation number, stop
741 }
742 }
743
744 if (args)
745 return; // too many arguments, stop
746
747 finalizeTranslationData(QV4::CompiledData::Binding::Type_TranslationById, translationData);
748 } else if (base == QLatin1String("QT_TR_NOOP") || base == QLatin1String("QT_TRID_NOOP")) {
749 if (!args || !args->expression)
750 return; // no arguments, stop
751
753 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
754 str = arg1->value;
755 } else {
756 return; // first argument is not a string, stop
757 }
758
759 args = args->next;
760 if (args)
761 return; // too many arguments, stop
762
764 translationData.number = registerMainString(str);
765 finalizeTranslationData(QV4::CompiledData::Binding::Type_String, translationData);
766 } else if (base == QLatin1String("QT_TRANSLATE_NOOP")) {
767 if (!args || !args->expression)
768 return; // no arguments, stop
769
770 args = args->next;
771 if (!args || !args->expression)
772 return; // no second arguments, stop
773
775 if (QQmlJS::AST::StringLiteral *arg2 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
776 str = arg2->value;
777 } else {
778 return; // first argument is not a string, stop
779 }
780
781 args = args->next;
782 if (args)
783 return; // too many arguments, stop
784
785 QV4::CompiledData::TranslationData fakeTranslationData;
786 fakeTranslationData.number = registerMainString(str);
787 finalizeTranslationData(QV4::CompiledData::Binding::Type_String, fakeTranslationData);
788 } else if (base == QLatin1String("qsTranslate")) {
790 translationData.number = -1;
791 translationData.commentIndex = 0; // empty string
792
793 if (!args || !args->next)
794 return; // less than 2 arguments, stop
795
796 QStringView translation;
798 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
799 translation = arg1->value;
800 } else {
801 return; // first argument is not a string, stop
802 }
803
804 translationData.contextIndex = registerContextString(translation);
805
806 args = args->next;
807 Q_ASSERT(args);
808
810 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
811 if (!arg2)
812 return; // second argument is not a string, stop
813 translationData.stringIndex = registerMainString(arg2->value);
814
815 args = args->next;
816 if (args) {
818 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
819 if (!arg3)
820 return; // third argument is not a string, stop
821 translationData.commentIndex = registerCommentString(arg3->value);
822
823 args = args->next;
824 if (args) {
826 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
827 translationData.number = int(arg4->value);
828 args = args->next;
829 } else {
830 return; // fourth argument is not a translation number, stop
831 }
832 }
833 }
834
835 if (args)
836 return; // too many arguments, stop
837
838 finalizeTranslationData(QV4::CompiledData::Binding::Type_Translation, translationData);
839 }
840}
841
842} // namespace QmlIR
843
845
846#endif // QQMLIRBUILDER_P_H
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
const_iterator constBegin() const noexcept
Definition qlist.h:615
const_iterator constEnd() const noexcept
Definition qlist.h:616
QString toString() const
UiQualifiedId * typeArgument
UiQualifiedId * typeId
UiObjectInitializer * initializer
SourceLocation firstSourceLocation() const override
Definition qset.h:18
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:76
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
\inmodule QtCore
QString str
[2]
employee setId(37)
QSet< QString >::iterator it
auto signal
short next
Definition keywords.cpp:445
Combined button and popup list for selecting options.
std::function< QByteArray()> DependentTypesHasher
CodegenWarningInterface * defaultCodegenWarningInterface()
void tryGeneratingTranslationBindingBase(QStringView base, QQmlJS::AST::ArgumentList *args, RegisterMainString registerMainString, RegisterCommentString registerCommentString, RegisterContextString registerContextString, FinalizeTranslationData finalizeTranslationData)
#define Q_DECLARE_TR_FUNCTIONS(context)
static const QCssKnownValue properties[NumProperties - 1]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
const char * typeName
GLint location
GLboolean GLboolean GLboolean b
GLuint index
[2]
GLenum GLuint id
[7]
GLenum GLenum GLsizei count
GLfloat GLfloat f
GLenum type
GLbitfield flags
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint name
GLint first
GLenum GLenum GLsizei void GLsizei void * column
GLhandleARB obj
[2]
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
static bool isSignalPropertyName(const QString &signalName)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_QML_COMPILER_PRIVATE_EXPORT
unsigned int quint32
Definition qtypes.h:45
int qint32
Definition qtypes.h:44
QT_BEGIN_NAMESPACE typedef uchar * output
const char property[13]
Definition qwizard.cpp:101
QUrl url("example.com")
[constructor-url-reference]
QObject::connect nullptr
QGraphicsItem * item
QJSValueList args
QJSEngine engine
[0]
QString stringForIndex(int index) const
int registerString(const QString &str)
Object * objectAt(int i) const
QQmlJS::AST::UiProgram * program
QVector< Object * > objects
QString stringAt(int index) const
QV4::Compiler::Module jsModule
QV4::CompiledData::CompilationUnit javaScriptCompilationUnit
QV4::Compiler::JSUnitGenerator jsGenerator
int objectCount() const
int registerString(const QString &str)
bool isSingleton() const
QList< Pragma * > pragmas
QList< const QV4::CompiledData::Import * > imports
QQmlJS::Engine jsParserEngine
QV4::CompiledData::Location location
PoolList< EnumValue >::Iterator enumValuesEnd() const
PoolList< EnumValue > * enumValues
int enumValueCount() const
PoolList< EnumValue >::Iterator enumValuesBegin() const
QV4::CompiledData::Location location
const Parameter * formalsBegin() const
QV4::CompiledData::ParameterType returnType
QQmlJS::FixedPoolArray< Parameter > formals
const Parameter * formalsEnd() const
QVector< Object * > _objects
QList< const QV4::CompiledData::Import * > _imports
QList< Pragma * > _pragmas
bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiObjectDefinition *node, Object *declarationsOverride=nullptr)
void throwRecursionDepthError() override
QString stringAt(int index) const
QQmlJS::MemoryPool * pool
QV4::CompiledData::TypeReferenceMap _typeReferences
Property * _propertyDeclaration
QList< QQmlJS::DiagnosticMessage > errors
QV4::Compiler::JSUnitGenerator * jsGenerator
quint32 registerString(const QString &str) const
QSet< QString > inlineComponentsNames
QSet< QString > illegalNames
QStringView textRefAt(const QQmlJS::SourceLocation &loc) const
InlineComponent * next
bool hasFlag(QV4::CompiledData::Object::Flag flag) const
int indexOfDefaultPropertyOrAlias
PoolList< Property >::Iterator propertiesEnd() const
PoolList< Property >::Iterator propertiesBegin() const
int requiredPropertyExtraDataCount() const
PoolList< Signal >::Iterator signalsEnd() const
int inlineComponentCount() const
const quint32 * namedObjectsInComponentTable() const
PoolList< RequiredPropertyExtraData >::Iterator requiredPropertyExtraDataEnd() const
PoolList< Binding >::Iterator bindingsEnd() const
int enumCount() const
PoolList< Function >::Iterator functionsBegin() const
QV4::CompiledData::Location location
Alias * firstAlias() const
int bindingCount() const
PoolList< Function >::Iterator functionsEnd() const
PoolList< Alias >::Iterator aliasesBegin() const
PoolList< RequiredPropertyExtraData >::Iterator requiredPropertyExtraDataBegin() const
PoolList< Enum >::Iterator enumsEnd() const
qint32 objectId() const
Binding * firstBinding() const
const Property * firstProperty() const
const Enum * firstEnum() const
Object * declarationsOverride
int signalCount() const
int functionCount() const
PoolList< Enum >::Iterator enumsBegin() const
PoolList< CompiledFunctionOrExpression > * functionsAndExpressions
Binding * unlinkBinding(Binding *before, Binding *binding)
const RequiredPropertyExtraData * requiredPropertyExtraData() const
bool hasAliasAsDefaultProperty() const
PoolList< InlineComponent >::Iterator inlineComponentsEnd() const
PoolList< Signal >::Iterator signalsBegin() const
int aliasCount() const
const Function * firstFunction() const
quint32 inheritedTypeNameIndex
PoolList< Binding >::Iterator bindingsBegin() const
PoolList< InlineComponent >::Iterator inlineComponentsBegin() const
const InlineComponent * inlineComponent() const
QQmlJS::FixedPoolArray< int > runtimeFunctionIndices
const Signal * firstSignal() const
QV4::CompiledData::Location locationOfIdProperty
QQmlJS::FixedPoolArray< quint32 > namedObjectsInComponent
int propertyCount() const
int namedObjectsInComponentCount() const
PoolList< Alias >::Iterator aliasesEnd() const
static bool initType(QV4::CompiledData::ParameterType *type, const IdGenerator &idGenerator, const QQmlJS::AST::Type *annotation)
static QV4::CompiledData::CommonType stringToBuiltinType(const QString &typeName)
std::forward_iterator_tag iterator_category
bool operator!=(const Iterator &rhs) const
const T * operator->() const
bool operator==(const Iterator &rhs) const
const T & operator*() const
T * findSortedInsertionPoint(T *item) const
void prepend(T *item)
T * unlink(T *before, T *item)
T * slowAt(int index) const
void insertAfter(T *insertionPoint, T *item)
int append(T *item)
NativeMethodBehaviorValue nativeMethodBehavior
ComponentBehaviorValue componentBehavior
ValueTypeBehaviorValues::Int valueTypeBehavior
Q_DECLARE_FLAGS(ValueTypeBehaviorValues, ValueTypeBehaviorValue)
QV4::CompiledData::Location location
FunctionSignatureBehaviorValue functionSignatureBehavior
ListPropertyAssignBehaviorValue listPropertyAssignBehavior
RequiredPropertyExtraData * next
int parameterCount() const
PoolList< Parameter > * parameters
PoolList< Parameter >::Iterator parametersEnd() const
QStringList parameterStringList(const QV4::Compiler::StringTableGenerator *stringPool) const
PoolList< Parameter >::Iterator parametersBegin() const
QV4::CompiledData::Location location