16#include <QtQmlCompiler/private/qqmlsasourcelocation_p.h>
22using namespace Qt::StringLiterals;
29
30
31
32
33
36
37
38
39
40
41
42
43
44
47
48
49
50
51
52
53
54
55
56
57
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
81
82
83
84
85
86
87
88
89
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
163
164
165
166
167
170
171
174BindingsPrivate::BindingsPrivate(QQmlSA::Binding::Bindings *iface) : q_ptr{ iface } { }
177
178
185
186
190 : m_bindings{ other.m_bindings.begin(), other.m_bindings.end() }, q_ptr{ iface }
195 : m_bindings{ std::move(other.m_bindings) }, q_ptr{ iface }
200
201
209
210
211
215 return m_bindings.constBegin();
219
220
228
229
230
234 return m_bindings.constEnd();
238
239
240
241
242
245
246
252
253
257
258
264
265
280
281
296
297
309 m_isAttached{ other.m_isAttached }
313QQmlSA::Binding
BindingPrivate::createBinding(
const QQmlJSMetaPropertyBinding &binding)
316 saBinding.d_func()->m_binding = binding;
325const QQmlJSMetaPropertyBinding
BindingPrivate::binding(
const QQmlSA::Binding &binding)
327 return binding.d_func()->m_binding;
331
332
333
340
341
348
349
356
357
358
365
366
373
374
381
382
383
389#if QT_DEPRECATED_SINCE(6
, 9
)
391
392
393
394
395
403
404
412
413
414
421
422
423
430
431
438
439
440
447
448
449
450
459
460
461
462
463
472
473
474
481
482
483
484
485
487
488
489
490
491
494
495
499
500
507
508
512
513
521
522
523
527 return m_methods.constBegin();
531
532
540
541
542
546 return m_methods.constEnd();
549MethodsPrivate::MethodsPrivate(QQmlSA::Method::Methods *iface) : q_ptr{ iface } { }
570 return m_method.methodName();
575 return QQmlSA::SourceLocationPrivate::createQQmlSASourceLocation(m_method.sourceLocation());
580 return m_method.methodType();
584
585
586
587
588
591
592
596
597
601
602
609
610
622
623
635
636
640
641
649
650
658
659
660
662
663
664
667
668
682 QQmlSA::Method saMethod;
683 auto &wrappedMethod = saMethod.d_func()->m_method;
684 wrappedMethod = jsMethod;
688QQmlSA::Method::Methods
691 QMultiHash<QString, QQmlSA::Method> saMethods;
692 for (
const auto &[key, value] : hash.asKeyValueRange()) {
693 saMethods.insert(key, MethodPrivate::createMethod(value));
696 QQmlSA::Method::Methods methods;
697 methods.d_func()->m_methods =
std::move(saMethods);
703 return method.d_func()->m_method;
720 return m_property.typeName();
725 return m_property.isValid();
729
730
731
732
735 return !m_property.isWritable();
739
740
743 return QQmlJSScope::createQQmlSAElement(m_property.type());
748 return property.d_func()->m_property;
753 QQmlSA::Property saProperty;
754 auto &wrappedProperty = saProperty.d_func()->m_property;
755 wrappedProperty = property;
760
761
762
763
764
767
768
772
773
778
779
786
787
799
800
812
813
817
818
826
827
835
836
844
845
853
854
855
857
858
859
868
869
870
871
872
875
876
883
884
891
892
893
896
897
908
909
910
913
914
921
922
929
930
937
938
945
946
953
954
961
962
969
970
977
978
985
986
987
994
995
1002
1003
1010
1011
1012
1019
1020
1021
1028
1029
1030
1037
1038
1039
1046
1047
1054
1055
1056
1057
1058
1061
1062
1063
1070
1071
1079
1080
1088
1089
1096
1097
1104
1105
1106
1113
1114
1115
1122
1123
1124
1132
1133
1145QQmlSA::Binding::Bindings
1146BindingsPrivate::createBindings(
const QMultiHash<QString, QQmlJSMetaPropertyBinding> &hash)
1148 QMultiHash<QString, QQmlSA::Binding> saBindings;
1149 for (
const auto &[key, value] : hash.asKeyValueRange()) {
1150 saBindings.insert(key, BindingPrivate::createBinding(value));
1153 QQmlSA::Binding::Bindings bindings;
1154 bindings.d_func()->m_bindings =
std::move(saBindings);
1173
1174
1181
1182
1189
1190
1199
1200
1201
1203
1204
1205
1213
1214
1215
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1235 Q_DECLARE_PUBLIC(GenericPass);
1245 PassManager *m_manager =
nullptr;
1247 GenericPass *q_ptr =
nullptr;
1251
1252
1257
1258
1262
1263
1270
1271
1272
1284
1285
1286
1299
1300
1301
1311
1312
1313
1326
1327
1328
1329
1330
1331
1342
1343
1344
1345
1346
1347
1364
1365
1373
1374
1375
1385
1386
1397
1398
1409
1410
1421
1422
1423
1424
1425
1432
1433
1441
1442
1443
1444
1445
1455 if (element.isNull() || QQmlJSScope::scope(element)->internalName().isEmpty()) {
1458 if (element.isNull() || element.baseType().isNull())
1459 return u"$INVALID$"_s;
1460 name = QQmlJSScope::scope(element.baseType())->internalName();
1462 name = QQmlJSScope::scope(element)->internalName();
1465 const QString filePath =
1466 (mode ==
Register || !element.baseType() ? element : element.baseType()).filePath();
1468 if (QQmlJSScope::scope(element)->isComposite() && !filePath.endsWith(u".h"))
1469 name += u'@' + filePath;
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1516 qWarning() <<
"Both the moduleName and the typeName must be specified "
1517 "for the pass to be registered for a specific element.";
1598
1599
1608 return QQmlJSScope::scope(element)->childScopesBegin();
1613 return QQmlJSScope::scope(element)->childScopesEnd();
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1709
1710
1766
1767
1768
1769
1770
1773
1774
1775
1778
1779
1780
1783
1784
1785
1786
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1838
1839
1840
1843
1844
1845
1846
1847
1848
1849
1852
1853
1854
1855
1856
1857
1865
1866
1867
1868
1869
1873
1874
1878
1879
1880
1881
1882
1895
1896
1897
1898
1899
1900
1901
1902
1913
1914
1915
1916
1917
1918
1919
1920
1921
1932
1933
1934
1935
1936
1937
1980 + u"' binding_scope: '"_s
2002
2003
2013 const QQmlSA::SourceLocation &location,
2014 const QString &replacement)
2015 : m_fixSuggestion{ fixDescription, QQmlSA::SourceLocationPrivate::sourceLocation(location),
2034 return m_fixSuggestion.fixDescription();
2039 return QQmlSA::SourceLocationPrivate::createQQmlSASourceLocation(m_fixSuggestion.location());
2044 return m_fixSuggestion.replacement();
2049 m_fixSuggestion.setFilename(fileName);
2054 return m_fixSuggestion.filename();
2059 m_fixSuggestion.setHint(hint);
2064 return m_fixSuggestion.hint();
2069 m_fixSuggestion.setAutoApplicable(autoApplicable);
2074 return m_fixSuggestion.isAutoApplicable();
2084 return saFixSuggestion.d_func()->m_fixSuggestion;
2088
2089
2090
2091
2092
2096
2097
2105
2106
2113
2114
2121
2122
2133
2134
2145
2146
2150
2151
2158
2159
2167
2168
2175
2176
2183
2184
2191
2192
2199
2200
2207
2208
2209
2216
2217
2224
2225
2226
2228
2229
2230
BindingPrivate(Binding *, const BindingPrivate &)
QMultiHash< QString, Binding >::const_iterator constBegin() const
QMultiHash< QString, Binding >::const_iterator constEnd() const
QQmlSA::SourceLocation location() const
void setHint(const QString &)
void setFileName(const QString &)
QString fixDescription() const
FixSuggestionPrivate(FixSuggestion *)
bool isAutoApplicable() const
void setAutoApplicable(bool autoApplicable=true)
FixSuggestionPrivate(FixSuggestion *, FixSuggestionPrivate &&)
QString replacement() const
FixSuggestionPrivate(FixSuggestion *, const FixSuggestionPrivate &)
GenericPassPrivate(GenericPass *iface, PassManager *manager)
MethodPrivate(Method *, const MethodPrivate &)
QQmlSA::SourceLocation sourceLocation() const
MethodType methodType() const
QString methodName() const
MethodsPrivate(QQmlSA::Method::Methods *, MethodsPrivate &&)
QMultiHash< QString, Method >::const_iterator constEnd() const
MethodsPrivate(QQmlSA::Method::Methods *, const MethodsPrivate &)
QMultiHash< QString, Method >::const_iterator constBegin() const
PropertyPrivate(Property *, const PropertyPrivate &)
PropertyPrivate(Property *, PropertyPrivate &&)
QQmlSA::Element type() const
Returns the type that this property was defined with.
bool isReadonly() const
Returns whether this property is readonly.
Q_QMLCOMPILER_EXPORT void emitWarningWithOptionalFix(GenericPass &pass, QAnyStringView diagnostic, const LoggerWarningId &id, const QQmlSA::SourceLocation &srcLocation, const std::optional< QQmlJSFixSuggestion > &fix)
static QQmlJS::ChildScopesIterator childScopesEnd(const Element &element)
static QQmlJS::ChildScopesIterator childScopesBegin(const Element &element)
bool isRegularBindingType(BindingType type)
static QString lookupName(const QQmlSA::Element &element, LookupMode mode=Lookup)