Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
187
188struct Enum
189{
192 PoolList<EnumValue> *enumValues;
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
252
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
272
274{
276};
277
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{
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(); }
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
379 PoolList<CompiledFunctionOrExpression> *functionsAndExpressions;
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
393 PoolList<Property> *properties;
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
462
464{
465 Document(bool debugMode);
469 QList<const QV4::CompiledData::Import *> imports;
470 QList<Pragma*> pragmas;
472 QVector<Object*> objects;
474
475 QQmlRefPointer<QV4::CompiledData::CompilationUnit> javaScriptCompilationUnit;
476
477 bool isSingleton() const {
478 return std::any_of(pragmas.constBegin(), pragmas.constEnd(), [](const Pragma *pragma) {
479 return pragma->type == Pragma::Singleton;
480 });
481 }
482
483 int registerString(const QString &str) { return jsGenerator.registerString(str); }
484 QString stringAt(int index) const { return jsGenerator.stringForIndex(index); }
485
486 int objectCount() const {return objects.size();}
487 Object* objectAt(int i) const {return objects.at(i);}
488};
489
491{
492 QmlIR::Document *document;
495
496public:
498
499 void pragmaLibrary() override;
500 void importFile(const QString &jsfile, const QString &module, int lineNumber, int column) override;
501 void importModule(const QString &uri, const QString &version, const QString &module, int lineNumber, int column) override;
502};
503
505{
506 Q_DECLARE_TR_FUNCTIONS(QQmlCodeGenerator)
507public:
508 IRBuilder(const QSet<QString> &illegalNames);
509 bool generateFromQml(const QString &code, const QString &url, Document *output);
510
511 using QQmlJS::AST::Visitor::visit;
512 using QQmlJS::AST::Visitor::endVisit;
513
514 bool visit(QQmlJS::AST::UiArrayMemberList *ast) override;
515 bool visit(QQmlJS::AST::UiImport *ast) override;
516 bool visit(QQmlJS::AST::UiPragma *ast) override;
517 bool visit(QQmlJS::AST::UiHeaderItemList *ast) override;
518 bool visit(QQmlJS::AST::UiObjectInitializer *ast) override;
519 bool visit(QQmlJS::AST::UiObjectMemberList *ast) override;
520 bool visit(QQmlJS::AST::UiParameterList *ast) override;
521 bool visit(QQmlJS::AST::UiProgram *) override;
522 bool visit(QQmlJS::AST::UiQualifiedId *ast) override;
523 bool visit(QQmlJS::AST::UiArrayBinding *ast) override;
524 bool visit(QQmlJS::AST::UiObjectBinding *ast) override;
525 bool visit(QQmlJS::AST::UiObjectDefinition *ast) override;
526 bool visit(QQmlJS::AST::UiInlineComponent *ast) override;
527 bool visit(QQmlJS::AST::UiEnumDeclaration *ast) override;
528 bool visit(QQmlJS::AST::UiPublicMember *ast) override;
529 bool visit(QQmlJS::AST::UiScriptBinding *ast) override;
530 bool visit(QQmlJS::AST::UiSourceElement *ast) override;
531 bool visit(QQmlJS::AST::UiRequired *ast) override;
532
534 {
535 recordError(QQmlJS::SourceLocation(),
536 QStringLiteral("Maximum statement or expression depth exceeded"));
537 }
538
539 void accept(QQmlJS::AST::Node *node);
540
541 // returns index in _objects
542 bool defineQMLObject(
543 int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId,
545 QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = nullptr);
546
548 int *objectIndex, QQmlJS::AST::UiObjectDefinition *node,
549 Object *declarationsOverride = nullptr)
550 {
552 return defineQMLObject(
553 objectIndex, node->qualifiedTypeNameId,
554 { location.startLine, location.startColumn }, node->initializer,
555 declarationsOverride);
556 }
557
559 QStringView asStringRef(QQmlJS::AST::Node *node);
560 static QTypeRevision extractVersion(QStringView string);
562 { return QStringView(sourceCode).mid(loc.offset, loc.length); }
564 const QQmlJS::SourceLocation &last) const;
565
566 void setBindingValue(QV4::CompiledData::Binding *binding, QQmlJS::AST::Statement *statement,
567 QQmlJS::AST::Node *parentNode);
568 void tryGeneratingTranslationBinding(QStringView base, QQmlJS::AST::ArgumentList *args, QV4::CompiledData::Binding *binding);
569
571 QQmlJS::AST::Node *parentNode);
572 void appendBinding(QQmlJS::AST::UiQualifiedId *name, int objectIndex, bool isOnAssignment = false);
573 void appendBinding(const QQmlJS::SourceLocation &qualifiedNameLocation,
574 const QQmlJS::SourceLocation &nameLocation, quint32 propertyNameIndex,
576 void appendBinding(const QQmlJS::SourceLocation &qualifiedNameLocation,
577 const QQmlJS::SourceLocation &nameLocation, quint32 propertyNameIndex,
578 int objectIndex, bool isListItem = false, bool isOnAssignment = false);
579
580 bool appendAlias(QQmlJS::AST::UiPublicMember *node);
581
582 Object *bindingsTarget() const;
583
585
586 // resolves qualified name (font.pixelSize for example) and returns the last name along
587 // with the object any right-hand-side of a binding should apply to.
588 bool resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, Object **object, bool onAssignment = false);
589
590 void recordError(const QQmlJS::SourceLocation &location, const QString &description);
591
592 quint32 registerString(const QString &str) const { return jsGenerator->registerString(str); }
593 template <typename _Tp> _Tp *New() { return pool->New<_Tp>(); }
594
595 QString stringAt(int index) const { return jsGenerator->stringForIndex(index); }
596
597 static bool isStatementNodeScript(QQmlJS::AST::Statement *statement);
598 static bool isRedundantNullInitializerForPropertyDeclaration(Property *property, QQmlJS::AST::Statement *statement);
599
600 QString sanityCheckFunctionNames(Object *obj, const QSet<QString> &illegalNames, QQmlJS::SourceLocation *errorLocation);
601
602 QList<QQmlJS::DiagnosticMessage> errors;
603
604 QSet<QString> illegalNames;
606
607 QList<const QV4::CompiledData::Import *> _imports;
608 QList<Pragma*> _pragmas;
609 QVector<Object*> _objects;
610
612
615
619
620 bool insideInlineComponent = false;
621};
622
624{
626
627private:
628 typedef bool (Binding::*BindingFilter)() const;
629 char *writeBindings(char *bindingPtr, const Object *o, BindingFilter filter) const;
630};
631
633{
634 JSCodeGen(Document *document, const QSet<QString> &globalNames,
637 bool storeSourceLocations = false);
638
639 // Returns mapping from input functions to index in IR::Module::functions / compiledData->runtimeFunctions
640 QVector<int>
641 generateJSCodeForFunctionsAndBindings(const QList<CompiledFunctionOrExpression> &functions);
642
643 bool generateRuntimeFunctions(QmlIR::Object *object);
644
645private:
646 Document *document;
647};
648
649// RegisterStringN ~= std::function<int(QStringView)>
650// FinalizeTranlationData ~= std::function<void(QV4::CompiledData::Binding::ValueType, QV4::CompiledData::TranslationData)>
651/*
652 \internal
653 \a base: name of the potential translation function
654 \a args: arguments to the function call
655 \a registerMainString: Takes the first argument passed to the translation function, and it's
656 result will be stored in a TranslationData's stringIndex for translation bindings and in numbeIndex
657 for string bindings.
658 \a registerCommentString: Takes the comment argument passed to some of the translation functions.
659 Result will be stored in a TranslationData's commentIndex
660 \a finalizeTranslationData: Takes the type of the binding and the previously set up TranslationData
661 */
662template<
663 typename RegisterMainString,
664 typename RegisterCommentString,
665 typename RegisterContextString,
666 typename FinalizeTranslationData>
668 RegisterMainString registerMainString,
669 RegisterCommentString registerCommentString,
670 RegisterContextString registerContextString,
671 FinalizeTranslationData finalizeTranslationData
672 )
673{
674 if (base == QLatin1String("qsTr")) {
676 translationData.number = -1;
677
678 // empty string
679 translationData.commentIndex = 0;
680
681 // No context (not empty string)
682 translationData.contextIndex = QV4::CompiledData::TranslationData::NoContextIndex;
683
684 if (!args || !args->expression)
685 return; // no arguments, stop
686
687 QStringView translation;
688 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
689 translation = arg1->value;
690 } else {
691 return; // first argument is not a string, stop
692 }
693
694 translationData.stringIndex = registerMainString(translation);
695
696 args = args->next;
697
698 if (args) {
699 QQmlJS::AST::StringLiteral *arg2 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
700 if (!arg2)
701 return; // second argument is not a string, stop
702 translationData.commentIndex = registerCommentString(arg2->value);
703
704 args = args->next;
705 if (args) {
706 if (QQmlJS::AST::NumericLiteral *arg3 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
707 translationData.number = int(arg3->value);
708 args = args->next;
709 } else {
710 return; // third argument is not a translation number, stop
711 }
712 }
713 }
714
715 if (args)
716 return; // too many arguments, stop
717
718 finalizeTranslationData(QV4::CompiledData::Binding::Type_Translation, translationData);
719 } else if (base == QLatin1String("qsTrId")) {
721 translationData.number = -1;
722
723 // empty string, but unused
724 translationData.commentIndex = 0;
725
726 // No context (not empty string)
727 translationData.contextIndex = QV4::CompiledData::TranslationData::NoContextIndex;
728
729 if (!args || !args->expression)
730 return; // no arguments, stop
731
733 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
734 id = arg1->value;
735 } else {
736 return; // first argument is not a string, stop
737 }
738 translationData.stringIndex = registerMainString(id);
739
740 args = args->next;
741
742 if (args) {
743 if (QQmlJS::AST::NumericLiteral *arg3 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
744 translationData.number = int(arg3->value);
745 args = args->next;
746 } else {
747 return; // third argument is not a translation number, stop
748 }
749 }
750
751 if (args)
752 return; // too many arguments, stop
753
754 finalizeTranslationData(QV4::CompiledData::Binding::Type_TranslationById, translationData);
755 } else if (base == QLatin1String("QT_TR_NOOP") || base == QLatin1String("QT_TRID_NOOP")) {
756 if (!args || !args->expression)
757 return; // no arguments, stop
758
760 if (QQmlJS::AST::StringLiteral *arg1 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
761 str = arg1->value;
762 } else {
763 return; // first argument is not a string, stop
764 }
765
766 args = args->next;
767 if (args)
768 return; // too many arguments, stop
769
771 translationData.number = registerMainString(str);
772 finalizeTranslationData(QV4::CompiledData::Binding::Type_String, translationData);
773 } else if (base == QLatin1String("QT_TRANSLATE_NOOP")) {
774 if (!args || !args->expression)
775 return; // no arguments, stop
776
777 args = args->next;
778 if (!args || !args->expression)
779 return; // no second arguments, stop
780
782 if (QQmlJS::AST::StringLiteral *arg2 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
783 str = arg2->value;
784 } else {
785 return; // first argument is not a string, stop
786 }
787
788 args = args->next;
789 if (args)
790 return; // too many arguments, stop
791
792 QV4::CompiledData::TranslationData fakeTranslationData;
793 fakeTranslationData.number = registerMainString(str);
794 finalizeTranslationData(QV4::CompiledData::Binding::Type_String, fakeTranslationData);
795 } else if (base == QLatin1String("qsTranslate")) {
797 translationData.number = -1;
798 translationData.commentIndex = 0; // empty string
799
800 if (!args || !args->next)
801 return; // less than 2 arguments, stop
802
803 QStringView translation;
805 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression)) {
806 translation = arg1->value;
807 } else {
808 return; // first argument is not a string, stop
809 }
810
811 translationData.contextIndex = registerContextString(translation);
812
813 args = args->next;
814 Q_ASSERT(args);
815
817 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
818 if (!arg2)
819 return; // second argument is not a string, stop
820 translationData.stringIndex = registerMainString(arg2->value);
821
822 args = args->next;
823 if (args) {
825 = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(args->expression);
826 if (!arg3)
827 return; // third argument is not a string, stop
828 translationData.commentIndex = registerCommentString(arg3->value);
829
830 args = args->next;
831 if (args) {
833 = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(args->expression)) {
834 translationData.number = int(arg4->value);
835 args = args->next;
836 } else {
837 return; // fourth argument is not a translation number, stop
838 }
839 }
840 }
841
842 if (args)
843 return; // too many arguments, stop
844
845 finalizeTranslationData(QV4::CompiledData::Binding::Type_Translation, translationData);
846 }
847}
848
849} // namespace QmlIR
850
852
853#endif // QQMLIRBUILDER_P_H
QString toString() const
UiQualifiedId * typeArgument
UiQualifiedId * typeId
UiObjectInitializer * initializer
SourceLocation firstSourceLocation() const override
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:78
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:129
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
\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 QStringList aliases(const QQmlJSScope::ConstPtr &scope)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
static QT_BEGIN_NAMESPACE const char * asString(QSSGRenderGraphObject::Type type)
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_EXPORT
unsigned int quint32
Definition qtypes.h:50
int qint32
Definition qtypes.h:49
unsigned int uint
Definition qtypes.h:34
static const uint base
Definition qurlidna.cpp:20
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)
QQmlRefPointer< QV4::CompiledData::CompilationUnit > javaScriptCompilationUnit
Object * objectAt(int i) const
QQmlJS::AST::UiProgram * program
QVector< Object * > objects
QString stringAt(int index) const
QV4::Compiler::Module jsModule
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