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;
707
708
709
710
725 return m_property.typeName();
730 return m_property.isValid();
734
735
736
737
740 return !m_property.isWritable();
744
745
748 return QQmlJSScope::createQQmlSAElement(m_property.type());
753 return property.d_func()->m_property;
758 QQmlSA::Property saProperty;
759 auto &wrappedProperty = saProperty.d_func()->m_property;
760 wrappedProperty = property;
765
766
767
768
769
772
773
777
778
783
784
791
792
804
805
817
818
822
823
831
832
840
841
849
850
858
859
860
862
863
864
873
874
875
876
877
880
881
888
889
896
897
898
901
902
913
914
915
918
919
926
927
934
935
942
943
950
951
958
959
966
967
974
975
982
983
990
991
992
999
1000
1007
1008
1015
1016
1017
1024
1025
1026
1033
1034
1035
1042
1043
1044
1051
1052
1059
1060
1061
1062
1063
1066
1067
1068
1075
1076
1084
1085
1093
1094
1101
1102
1109
1110
1111
1118
1119
1120
1127
1128
1129
1137
1138
1150QQmlSA::Binding::Bindings
1151BindingsPrivate::createBindings(
const QMultiHash<QString, QQmlJSMetaPropertyBinding> &hash)
1153 QMultiHash<QString, QQmlSA::Binding> saBindings;
1154 for (
const auto &[key, value] : hash.asKeyValueRange()) {
1155 saBindings.insert(key, BindingPrivate::createBinding(value));
1158 QQmlSA::Binding::Bindings bindings;
1159 bindings.d_func()->m_bindings =
std::move(saBindings);
1178
1179
1186
1187
1194
1195
1204
1205
1206
1208
1209
1210
1218
1219
1220
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1240 Q_DECLARE_PUBLIC(GenericPass);
1250 PassManager *m_manager =
nullptr;
1252 GenericPass *q_ptr =
nullptr;
1256
1257
1262
1263
1267
1268
1275
1276
1277
1289
1290
1291
1304
1305
1306
1316
1317
1318
1331
1332
1333
1334
1335
1336
1347
1348
1349
1350
1351
1352
1369
1370
1378
1379
1380
1390
1391
1402
1403
1414
1415
1426
1427
1428
1429
1430
1437
1438
1446
1447
1448
1449
1450
1460 if (element.isNull() || QQmlJSScope::scope(element)->internalName().isEmpty()) {
1463 if (element.isNull() || element.baseType().isNull())
1464 return u"$INVALID$"_s;
1465 name = QQmlJSScope::scope(element.baseType())->internalName();
1467 name = QQmlJSScope::scope(element)->internalName();
1470 const QString filePath =
1471 (mode ==
Register || !element.baseType() ? element : element.baseType()).filePath();
1473 if (QQmlJSScope::scope(element)->isComposite() && !filePath.endsWith(u".h"))
1474 name += u'@' + filePath;
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1521 qWarning() <<
"Both the moduleName and the typeName must be specified "
1522 "for the pass to be registered for a specific element.";
1603
1604
1613 return QQmlJSScope::scope(element)->childScopesBegin();
1618 return QQmlJSScope::scope(element)->childScopesEnd();
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1714
1715
1771
1772
1773
1774
1775
1778
1779
1780
1783
1784
1785
1788
1789
1790
1791
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
1836
1837
1838
1839
1840
1843
1844
1845
1848
1849
1850
1851
1852
1853
1854
1857
1858
1859
1860
1861
1862
1870
1871
1872
1873
1874
1878
1879
1883
1884
1885
1886
1887
1900
1901
1902
1903
1904
1905
1906
1907
1918
1919
1920
1921
1922
1923
1924
1925
1926
1937
1938
1939
1940
1941
1942
1985 + u"' binding_scope: '"_s
2007
2008
2018 const QQmlSA::SourceLocation &location,
2019 const QString &replacement)
2020 : m_fixSuggestion{ fixDescription, QQmlSA::SourceLocationPrivate::sourceLocation(location),
2039 return m_fixSuggestion.fixDescription();
2044 return QQmlSA::SourceLocationPrivate::createQQmlSASourceLocation(m_fixSuggestion.location());
2049 return m_fixSuggestion.replacement();
2054 m_fixSuggestion.setFilename(fileName);
2059 return m_fixSuggestion.filename();
2064 m_fixSuggestion.setHint(hint);
2069 return m_fixSuggestion.hint();
2074 m_fixSuggestion.setAutoApplicable(autoApplicable);
2079 return m_fixSuggestion.isAutoApplicable();
2089 return saFixSuggestion.d_func()->m_fixSuggestion;
2093
2094
2095
2096
2097
2101
2102
2110
2111
2118
2119
2126
2127
2138
2139
2150
2151
2155
2156
2163
2164
2172
2173
2180
2181
2188
2189
2196
2197
2204
2205
2212
2213
2214
2221
2222
2229
2230
2231
2233
2234
2235
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)
Combined button and popup list for selecting options.