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
qqmlsa.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "qqmlsa.h"
5#include "qqmlsa_p.h"
7
8#include "qqmljsscope_p.h"
9#include "qqmljslogger_p.h"
12#include "qqmljsutils_p.h"
13#include "qdeferredpointer_p.h"
14
15#include <QtQmlCompiler/private/qqmlsasourcelocation_p.h>
16
17#include <memory>
18#include <new>
19
21
22using namespace Qt::StringLiterals;
23
24namespace QQmlSA {
25
26static_assert(QQmlJSScope::sizeofQQmlSAElement() == sizeof(Element));
27
43
45
47 : d_ptr{ new BindingsPrivate{ this, *other.d_func() } }
48{
49}
50
52
54 : m_bindings{ other.m_bindings.begin(), other.m_bindings.end() }, q_ptr{ interface }
55{
56}
57
62
67{
68 Q_D(const Bindings);
69 return d->constBegin();
70}
71
73{
74 return m_bindings.constBegin();
75}
76
81{
82 Q_D(const Bindings);
83 return d->constEnd();
84}
85
87{
88 return m_bindings.constEnd();
89}
90
98Binding::Binding() : d_ptr{ new BindingPrivate{ this } } { }
99
101
102Binding::Binding(const Binding &other) : d_ptr{ new BindingPrivate{ this, *other.d_func() } } { }
103
105 : d_ptr{ new BindingPrivate{ this, *other.d_func() } } { }
106
108{
109 if (*this == other)
110 return *this;
111
112 d_func()->m_binding = other.d_func()->m_binding;
113 d_func()->q_ptr = this;
114 return *this;
115}
116
118{
119 if (*this == other)
120 return *this;
121
122 d_func()->m_binding = std::move(other.d_func()->m_binding);
123 d_func()->q_ptr = this;
124 return *this;
125}
126
127Binding::~Binding() = default;
128
129bool Binding::operatorEqualsImpl(const Binding &lhs, const Binding &rhs)
130{
131 return lhs.d_func()->m_binding == rhs.d_func()->m_binding;
132}
133
135 : m_binding{ other.m_binding }, q_ptr{ interface }
136{
137}
138
140{
141 QQmlSA::Binding saBinding;
142 saBinding.d_func()->m_binding = binding;
143 return saBinding;
144}
145
147{
148 return binding.d_func()->m_binding;
149}
150
152{
153 return binding.d_func()->m_binding;
154}
155
164
166{
167 return BindingPrivate::binding(*this).bindingType();
168}
169
175{
176 return BindingPrivate::binding(*this).stringValue();
177}
178
183{
184 return BindingPrivate::binding(*this).propertyName();
185}
186
195
204
210{
211 return BindingPrivate::binding(*this).numberValue();
212}
213
219{
220 return BindingPrivate::binding(*this).scriptKind();
221}
222
227{
228 return BindingPrivate::binding(*this).hasObject();
229}
230
239
241{
242 const auto &jsBinding = BindingPrivate::binding(*this);
243 return jsBinding.bindingType() == BindingType::Script
244 && jsBinding.scriptValueType() == ScriptValue_Undefined;
245}
246
253{
254 return QQmlJSMetaPropertyBinding::isLiteralBinding(bindingType);
255}
256
258
260 : d_ptr{ new MethodsPrivate{ this, *other.d_func() } }
261{
262}
263
265
270{
271 Q_D(const Methods);
272 return d->constBegin();
273}
274
276{
277 return m_methods.constBegin();
278}
279
284{
285 Q_D(const Methods);
286 return d->constEnd();
287}
289{
290 return m_methods.constEnd();
291}
292
294
296 : m_methods{ other.m_methods }, q_ptr{ interface }
297{
298}
299
301 : m_methods{ std::move(other.m_methods) }, q_ptr{ interface }
302{
303}
304
306
308 : m_method{ other.m_method }, q_ptr{ interface }
309{
310}
311
313{
314 return m_method.methodName();
315}
316
321
323{
324 return m_method.methodType();
325}
326
334Method::Method() : d_ptr{ new MethodPrivate{ this } } { }
335
336Method::Method(const Method &other) : d_ptr{ new MethodPrivate{ this, *other.d_func() } } { }
337
339 : d_ptr{ new MethodPrivate{ this, std::move(*other.d_func()) } }
340{
341}
342
344{
345 if (*this == other)
346 return *this;
347
348 d_func()->m_method = other.d_func()->m_method;
349 d_func()->q_ptr = this;
350 return *this;
351}
352
354{
355 if (*this == other)
356 return *this;
357
358 d_func()->m_method = std::move(other.d_func()->m_method);
359 d_func()->q_ptr = this;
360 return *this;
361}
362
363Method::~Method() = default;
364
369{
370 Q_D(const Method);
371 return d->methodName();
372}
373
379{
380 Q_D(const Method);
381 return d->methodType();
382}
383
388{
389 Q_D(const Method);
390 return d->sourceLocation();
391}
392
393bool Method::operatorEqualsImpl(const Method &lhs, const Method &rhs)
394{
395 return lhs.d_func()->m_method == rhs.d_func()->m_method;
396}
397
399{
400 QQmlSA::Method saMethod;
401 auto &wrappedMethod = saMethod.d_func()->m_method;
402 wrappedMethod = jsMethod;
403 return saMethod;
404}
405
407MethodsPrivate::createMethods(const QMultiHash<QString, QQmlJSMetaMethod> &hash)
408{
409 QMultiHash<QString, QQmlSA::Method> saMethods;
410 for (const auto &[key, value] : hash.asKeyValueRange()) {
411 saMethods.insert(key, MethodPrivate::createMethod(value));
412 }
413
415 methods.d_func()->m_methods = std::move(saMethods);
416 return methods;
417}
418
420{
421 return method.d_func()->m_method;
422}
423
425
427 : m_property{ other.m_property }, q_ptr{ interface }
428{
429}
430
432 : m_property{ std::move(other.m_property) }, q_ptr{ interface }
433{
434}
435
437{
438 return m_property.typeName();
439}
440
442{
443 return m_property.isValid();
444}
445
452{
453 return !m_property.isWritable();
454}
455
463
465{
466 return property.d_func()->m_property;
467}
468
470{
471 QQmlSA::Property saProperty;
472 auto &wrappedProperty = saProperty.d_func()->m_property;
473 wrappedProperty = property;
474 return saProperty;
475}
476
485
487 : d_ptr{ new PropertyPrivate{ this, *other.d_func() } } { }
488
490 : d_ptr{ new PropertyPrivate{ this, std::move(*other.d_func()) } }
491{
492}
493
495{
496 if (*this == other)
497 return *this;
498
499 d_func()->m_property = other.d_func()->m_property;
500 d_func()->q_ptr = this;
501 return *this;
502}
503
505{
506 if (*this == other)
507 return *this;
508
509 d_func()->m_property = std::move(other.d_func()->m_property);
510 d_func()->q_ptr = this;
511 return *this;
512}
513
514Property::~Property() = default;
515
520{
521 Q_D(const Property);
522 return d->typeName();
523}
524
526{
527 Q_D(const Property);
528 return d->isValid();
529}
530
532{
533 Q_D(const Property);
534 return d->isReadonly();
535}
536
538{
539 Q_D(const Property);
540 return d->type();
541}
542
543
544bool Property::operatorEqualsImpl(const Property &lhs, const Property &rhs)
545{
546 return lhs.d_func()->m_property == rhs.d_func()->m_property;
547}
548
556Element::Element()
557{
558 new (m_data) QQmlJSScope::ConstPtr();
559}
560
561Element::Element(const Element &other)
562{
564}
565
566Element &Element::operator=(const Element &other)
567{
568 if (this == &other)
569 return *this;
570
571 *reinterpret_cast<QQmlJSScope::ConstPtr *>(m_data) = QQmlJSScope::scope(other);
572 return *this;
573}
574
575Element::~Element()
576{
577 (*reinterpret_cast<QQmlJSScope::ConstPtr *>(m_data)).QQmlJSScope::ConstPtr::~ConstPtr();
578}
579
583QQmlJSScope::ScopeType Element::scopeType() const
584{
585 return QQmlJSScope::scope(*this)->scopeType();
586}
587
591Element Element::baseType() const
592{
593 return QQmlJSScope::createQQmlSAElement(QQmlJSScope::scope(*this)->baseType());
594}
595
599QString Element::baseTypeName() const
600{
601 return QQmlJSScope::prettyName(QQmlJSScope::scope(*this)->baseTypeName());
602}
603
607Element Element::parentScope() const
608{
609 return QQmlJSScope::createQQmlSAElement(QQmlJSScope::scope(*this)->parentScope());
610}
611
615bool Element::inherits(const Element &element) const
616{
617 return QQmlJSScope::scope(*this)->inherits(QQmlJSScope::scope(element));
618}
619
620bool Element::isNull() const
621{
622 return QQmlJSScope::scope(*this).isNull();
623}
624
628QString Element::internalId() const
629{
630 return QQmlJSScope::scope(*this)->internalName();
631}
632
637AccessSemantics Element::accessSemantics() const
638{
639 return QQmlJSScope::scope(*this)->accessSemantics();
640}
641
646{
647 return QQmlJSScope::scope(*this)->isComposite();
648}
649
653bool Element::hasProperty(const QString &propertyName) const
654{
655 return QQmlJSScope::scope(*this)->hasProperty(propertyName);
656}
657
662bool Element::hasOwnProperty(const QString &propertyName) const
663{
664 return QQmlJSScope::scope(*this)->hasOwnProperty(propertyName);
665}
666
672{
673 return PropertyPrivate::createProperty(QQmlJSScope::scope(*this)->property(propertyName));
674}
675
680bool Element::isPropertyRequired(const QString &propertyName) const
681{
682 return QQmlJSScope::scope(*this)->isPropertyRequired(propertyName);
683}
684
689QString Element::defaultPropertyName() const
690{
691 return QQmlJSScope::scope(*this)->defaultPropertyName();
692}
693
697bool Element::hasMethod(const QString &methodName) const
698{
699 return QQmlJSScope::scope(*this)->hasMethod(methodName);
700}
701
713Method::Methods Element::ownMethods() const
714{
715 return MethodsPrivate::createMethods(QQmlJSScope::scope(*this)->ownMethods());
716}
717
721QQmlSA::SourceLocation Element::sourceLocation() const
722{
724 QQmlJSScope::scope(*this)->sourceLocation());
725}
726
730QString Element::filePath() const
731{
732 return QQmlJSScope::scope(*this)->filePath();
733}
734
738bool Element::hasPropertyBindings(const QString &name) const
739{
740 return QQmlJSScope::scope(*this)->hasPropertyBindings(name);
741}
742
747bool Element::hasOwnPropertyBindings(const QString &propertyName) const
748{
749 return QQmlJSScope::scope(*this)->hasOwnPropertyBindings(propertyName);
750}
751
756Binding::Bindings Element::ownPropertyBindings() const
757{
758 return BindingsPrivate::createBindings(QQmlJSScope::scope(*this)->ownPropertyBindings());
759}
760
765Binding::Bindings Element::ownPropertyBindings(const QString &propertyName) const
766{
768 QQmlJSScope::scope(*this)->ownPropertyBindings(propertyName));
769}
770
774QList<Binding> Element::propertyBindings(const QString &propertyName) const
775{
776 const auto &bindings = QQmlJSScope::scope(*this)->propertyBindings(propertyName);
777
778 QList<Binding> saBindings;
779 for (const auto &jsBinding : bindings) {
780 saBindings.push_back(BindingPrivate::createBinding(jsBinding));
781 }
782 return saBindings;
783}
784
786BindingsPrivate::createBindings(const QMultiHash<QString, QQmlJSMetaPropertyBinding> &hash)
787{
788 QMultiHash<QString, QQmlSA::Binding> saBindings;
789 for (const auto &[key, value] : hash.asKeyValueRange()) {
790 saBindings.insert(key, BindingPrivate::createBinding(value));
791 }
792
794 bindings.d_func()->m_bindings = std::move(saBindings);
795 return bindings;
796}
797
801{
802 QMultiHash<QString, QQmlSA::Binding> saBindings;
803 for (auto it = iterators.first; it != iterators.second; ++it) {
804 saBindings.insert(it.key(), BindingPrivate::createBinding(it.value()));
805 }
806
808 bindings.d_func()->m_bindings = std::move(saBindings);
809 return bindings;
810}
811
812Element::operator bool() const
813{
814 return bool(QQmlJSScope::scope(*this));
815}
816
817bool Element::operator!() const
818{
819 return !QQmlJSScope::scope(*this);
820}
821
825QString Element::name() const
826{
827 if (isNull())
828 return {};
829 return QQmlJSScope::prettyName(QQmlJSScope::scope(*this)->internalName());
830}
831
832bool Element::operatorEqualsImpl(const Element &lhs, const Element &rhs)
833{
834 return QQmlJSScope::scope(lhs) == QQmlJSScope::scope(rhs);
835}
836
837qsizetype Element::qHashImpl(const Element &key, qsizetype seed) noexcept
838{
840}
841
855 Q_DECLARE_PUBLIC(GenericPass);
856
857public:
859 : m_manager{ manager }, q_ptr{ interface }
860 {
862 }
863
864private:
865 PassManager *m_manager;
866
867 GenericPass *q_ptr;
868};
869
870GenericPass::~GenericPass() = default;
871
877
882{
883 emitWarning(diagnostic, id, QQmlSA::SourceLocation{});
884}
885
891 QQmlSA::SourceLocation srcLocation)
892{
893 Q_D(const GenericPass);
894 PassManagerPrivate::visitor(*d->m_manager)
895 ->logger()
896 ->log(diagnostic.toString(), id,
898}
899
905 QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)
906{
907 Q_D(const GenericPass);
908 PassManagerPrivate::visitor(*d->m_manager)
909 ->logger()
910 ->log(diagnostic.toString(), id,
911 QQmlSA::SourceLocationPrivate::sourceLocation(srcLocation), true, true,
913}
914
920{
921 Q_D(const GenericPass);
922 const auto scope =
923 PassManagerPrivate::visitor(*d->m_manager)->imports().type(typeName.toString()).scope;
925}
926
932{
934 const auto scope = QQmlJSScope::scope(type);
935
936 if (scope.isNull())
938
939 return QQmlJSScope::createQQmlSAElement(scope->attachedType());
940}
941
950{
951 Q_D(const GenericPass);
952 QQmlJSImporter *typeImporter = PassManagerPrivate::visitor(*d->m_manager)->importer();
953 const auto module = typeImporter->importModule(moduleName.toString());
954 const auto scope = module.type(typeName.toString()).scope;
956}
957
966{
967 Q_D(const GenericPass);
968 QQmlJSImporter *typeImporter = PassManagerPrivate::visitor(*d->m_manager)->importer();
969 auto typeNameString = typeName.toString();
970 // we have to check both cpp names
971 auto scope = typeImporter->builtinInternalNames().type(typeNameString).scope;
972 if (!scope) {
973 // and qml names (e.g. for bool) - builtinImportHelper is private, so we can't do it in one call
974 auto builtins = typeImporter->importBuiltins();
975 scope = builtins.type(typeNameString).scope;
976 }
978}
979
984{
985 const auto &resolvedType = resolveType(moduleName, typeName);
986 return QQmlJSScope::createQQmlSAElement(QQmlJSScope::scope(resolvedType)->attachedType());
987}
988
994{
995 Q_D(const GenericPass);
996
998 PassManagerPrivate::resolver(*d->m_manager)));
999}
1000
1005{
1006 Q_D(const GenericPass);
1007 const auto scope = PassManagerPrivate::visitor(*d->m_manager)
1008 ->addressableScopes()
1009 .scope(id.toString(), QQmlJSScope::scope(context));
1011}
1012
1017{
1018 Q_D(const GenericPass);
1019 return PassManagerPrivate::visitor(*d->m_manager)
1020 ->addressableScopes()
1022}
1023
1028{
1029 Q_D(const GenericPass);
1030 return PassManagerPrivate::visitor(*d->m_manager)
1031 ->logger()
1032 ->code()
1033 .mid(location.offset(), location.length());
1034}
1035
1043// explicitly defaulted out-of-line for PIMPL
1044PassManager::PassManager() = default;
1045PassManager::~PassManager() = default;
1046
1050void PassManager::registerElementPass(std::unique_ptr<ElementPass> pass)
1051{
1052 Q_D(PassManager);
1053 d->registerElementPass(std::move(pass));
1054}
1055
1062void PassManagerPrivate::registerElementPass(std::unique_ptr<ElementPass> pass)
1063{
1064 m_elementPasses.push_back(std::move(pass));
1065}
1066
1069{
1070 QString name;
1071 if (element.isNull() || QQmlJSScope::scope(element)->internalName().isEmpty()) {
1072 // Bail out with an invalid name, this type is so screwed up we can't do anything reasonable
1073 // with it We should have warned about it in another plac
1074 if (element.isNull() || element.baseType().isNull())
1075 return u"$INVALID$"_s;
1076 name = QQmlJSScope::scope(element.baseType())->internalName();
1077 } else {
1078 name = QQmlJSScope::scope(element)->internalName();
1079 }
1080
1081 const QString filePath =
1082 (mode == Register || !element.baseType() ? element : element.baseType()).filePath();
1083
1084 if (QQmlJSScope::scope(element)->isComposite() && !filePath.endsWith(u".h"))
1085 name += u'@' + filePath;
1086 return name;
1087}
1088
1119bool PassManager::registerPropertyPass(std::shared_ptr<PropertyPass> pass,
1121 QAnyStringView propertyName, bool allowInheritance)
1122{
1123 Q_D(PassManager);
1124 return d->registerPropertyPass(pass, moduleName, typeName, propertyName, allowInheritance);
1125}
1126
1127bool PassManagerPrivate::registerPropertyPass(std::shared_ptr<PropertyPass> pass,
1129 QAnyStringView propertyName, bool allowInheritance)
1130{
1131 if (moduleName.isEmpty() != typeName.isEmpty()) {
1132 qWarning() << "Both the moduleName and the typeName must be specified "
1133 "for the pass to be registered for a specific element.";
1134 }
1135
1136 QString name;
1137 if (!moduleName.isEmpty() && !typeName.isEmpty()) {
1138 auto typeImporter = m_visitor->importer();
1139 auto module = typeImporter->importModule(moduleName.toString());
1140 auto element = QQmlJSScope::createQQmlSAElement(module.type(typeName.toString()).scope);
1141
1142 if (element.isNull())
1143 return false;
1144
1145 name = lookupName(element, Register);
1146 }
1147 const QQmlSA::PropertyPassInfo passInfo{ propertyName.isEmpty()
1148 ? QStringList{}
1149 : QStringList{ propertyName.toString() },
1150 std::move(pass), allowInheritance };
1151 m_propertyPasses.insert({ name, passInfo });
1152
1153 return true;
1154}
1155
1157 const QString prefix, bool isAttached)
1158{
1159 const Element &currentScope = scope.isNull() ? element : scope;
1160 const auto ownBindings = currentScope.ownPropertyBindings();
1161 for (const auto &binding : ownBindings) {
1162 switch (binding.bindingType()) {
1164 addBindingSourceLocations(element, Element{ binding.groupType() },
1165 prefix + binding.propertyName() + u'.');
1166 break;
1168 addBindingSourceLocations(element, Element{ binding.attachingType() },
1169 prefix + binding.propertyName() + u'.', true);
1170 break;
1171 default:
1172 m_bindingsByLocation.insert({ binding.sourceLocation().offset(),
1173 BindingInfo{ prefix + binding.propertyName(), binding,
1174 currentScope, isAttached } });
1175
1176 if (binding.bindingType() != QQmlSA::BindingType::Script)
1177 analyzeBinding(element, QQmlSA::Element(), binding.sourceLocation());
1178 }
1179 }
1180}
1181
1186{
1187 Q_D(PassManager);
1188 d->analyze(root);
1189}
1190
1192{
1193 return QQmlJSScope::scope(element)->childScopesBegin();
1194}
1195
1197{
1198 return QQmlJSScope::scope(element)->childScopesEnd();
1199}
1200
1202{
1203 QList<Element> runStack;
1204 runStack.push_back(root);
1205 while (!runStack.isEmpty()) {
1206 auto element = runStack.takeLast();
1208 for (auto &elementPass : m_elementPasses)
1209 if (elementPass->shouldRun(element))
1210 elementPass->run(element);
1211
1212 for (auto it = childScopesBegin(element), end = childScopesEnd(element); it != end; ++it) {
1213 if ((*it)->scopeType() == QQmlSA::ScopeType::QMLScope)
1214 runStack.push_back(QQmlJSScope::createQQmlSAElement(*it));
1215 }
1216 }
1217}
1218
1219void PassManagerPrivate::analyzeWrite(const Element &element, QString propertyName,
1220 const Element &value, const Element &writeScope,
1222{
1223 for (PropertyPass *pass : findPropertyUsePasses(element, propertyName))
1224 pass->onWrite(element, propertyName, value, writeScope, location);
1225}
1226
1227void PassManagerPrivate::analyzeRead(const Element &element, QString propertyName,
1228 const Element &readScope, QQmlSA::SourceLocation location)
1229{
1230 for (PropertyPass *pass : findPropertyUsePasses(element, propertyName))
1231 pass->onRead(element, propertyName, readScope, location);
1232}
1233
1236{
1237 const auto info = m_bindingsByLocation.find(location.offset());
1238
1239 // If there's no matching binding that means we're in a nested Ret somewhere inside an
1240 // expression
1241 if (info == m_bindingsByLocation.end())
1242 return;
1243
1244 const QQmlSA::Element &bindingScope = info->second.bindingScope;
1245 const QQmlSA::Binding &binding = info->second.binding;
1246 const QString &propertyName = info->second.fullPropertyName;
1247
1248 for (PropertyPass *pass : findPropertyUsePasses(element, propertyName))
1249 pass->onBinding(element, propertyName, binding, bindingScope, value);
1250
1251 if (!info->second.isAttached || bindingScope.baseType().isNull())
1252 return;
1253
1254 for (PropertyPass *pass : findPropertyUsePasses(bindingScope.baseType(), propertyName))
1255 pass->onBinding(element, propertyName, binding, bindingScope, value);
1256}
1257
1275{
1276 return PassManagerPrivate::visitor(*this)->imports().hasType(u"$module$." + module.toString());
1277}
1278
1283{
1284 return !PassManagerPrivate::visitor(*this)->logger()->isCategoryIgnored(category);
1285}
1286
1291
1293{
1294 return manager.d_func()->m_typeResolver;
1295}
1296
1298 const QString &propertyName)
1299{
1300 QStringList typeNames { lookupName(element) };
1301
1303 QQmlJSScope::scope(element),
1305 Q_UNUSED(mode);
1306 typeNames.append(lookupName(QQmlJSScope::createQQmlSAElement(scope)));
1307 return false;
1308 });
1309
1310 QSet<PropertyPass *> passes;
1311
1312 for (const QString &typeName : typeNames) {
1313 for (auto &pass :
1314 { m_propertyPasses.equal_range(u""_s), m_propertyPasses.equal_range(typeName) }) {
1315 if (pass.first == pass.second)
1316 continue;
1317
1318 for (auto it = pass.first; it != pass.second; it++) {
1319 if (typeName != typeNames.constFirst() && !it->second.allowInheritance)
1320 continue;
1321 if (it->second.properties.isEmpty()
1322 || it->second.properties.contains(propertyName)) {
1323 passes.insert(it->second.pass.get());
1324 }
1325 }
1326 }
1327 }
1328 return passes;
1329}
1330
1331void DebugElementPass::run(const Element &element) {
1332 emitWarning(u"Type: " + element.baseTypeName(), qmlPlugin);
1333 if (auto bindings = element.propertyBindings(u"objectName"_s); !bindings.isEmpty()) {
1334 emitWarning(u"is named: " + bindings.first().stringValue(), qmlPlugin);
1335 }
1336 if (auto defPropName = element.defaultPropertyName(); !defPropName.isEmpty()) {
1337 emitWarning(u"binding " + QString::number(element.propertyBindings(defPropName).size())
1338 + u" elements to property "_s + defPropName,
1339 qmlPlugin);
1340 }
1341}
1342
1422{
1423 (void)element;
1424 return true;
1425}
1426
1442void PropertyPass::onBinding(const Element &element, const QString &propertyName,
1443 const QQmlSA::Binding &binding, const Element &bindingScope,
1444 const Element &value)
1445{
1446 Q_UNUSED(element);
1447 Q_UNUSED(propertyName);
1448 Q_UNUSED(binding);
1449 Q_UNUSED(bindingScope);
1450 Q_UNUSED(value);
1451}
1452
1459void PropertyPass::onRead(const Element &element, const QString &propertyName,
1460 const Element &readScope, QQmlSA::SourceLocation location)
1461{
1462 Q_UNUSED(element);
1463 Q_UNUSED(propertyName);
1464 Q_UNUSED(readScope);
1466}
1467
1475void PropertyPass::onWrite(const Element &element, const QString &propertyName,
1476 const Element &expressionType, const Element &writeScope,
1478{
1479 Q_UNUSED(element);
1480 Q_UNUSED(propertyName);
1481 Q_UNUSED(writeScope);
1482 Q_UNUSED(expressionType);
1484}
1485
1489
1490void DebugPropertyPass::onRead(const QQmlSA::Element &element, const QString &propertyName,
1492{
1493 emitWarning(u"onRead "_s
1494 + (QQmlJSScope::scope(element)->internalName().isEmpty()
1495 ? element.baseTypeName()
1496 : QQmlJSScope::scope(element)->internalName())
1497 + u' ' + propertyName + u' ' + QQmlJSScope::scope(readScope)->internalName()
1498 + u' ' + QString::number(location.startLine()) + u':'
1499 + QString::number(location.startColumn()),
1501}
1502
1503void DebugPropertyPass::onBinding(const QQmlSA::Element &element, const QString &propertyName,
1504 const QQmlSA::Binding &binding,
1505 const QQmlSA::Element &bindingScope, const QQmlSA::Element &value)
1506{
1507 const auto location = QQmlSA::SourceLocation{ binding.sourceLocation() };
1508 emitWarning(u"onBinding element: '"_s
1509 + (QQmlJSScope::scope(element)->internalName().isEmpty()
1510 ? element.baseTypeName()
1511 : QQmlJSScope::scope(element)->internalName())
1512 + u"' property: '"_s + propertyName + u"' value: '"_s
1513 + (value.isNull() ? u"NULL"_s
1514 : (QQmlJSScope::scope(value)->internalName().isNull()
1515 ? value.baseTypeName()
1516 : QQmlJSScope::scope(value)->internalName()))
1517 + u"' binding_scope: '"_s
1518 + (QQmlJSScope::scope(bindingScope)->internalName().isEmpty()
1519 ? bindingScope.baseTypeName()
1520 : QQmlJSScope::scope(bindingScope)->internalName())
1521 + u"' "_s + QString::number(location.startLine()) + u':'
1522 + QString::number(location.startColumn()),
1524}
1525
1526void DebugPropertyPass::onWrite(const QQmlSA::Element &element, const QString &propertyName,
1527 const QQmlSA::Element &value, const QQmlSA::Element &writeScope,
1529{
1530 emitWarning(u"onWrite "_s + element.baseTypeName() + u' ' + propertyName + u' '
1531 + QQmlJSScope::scope(value)->internalName() + u' '
1532 + QQmlJSScope::scope(writeScope)->internalName() + u' '
1533 + QString::number(location.startLine()) + u':'
1534 + QString::number(location.startColumn()),
1536}
1537
1541std::vector<std::shared_ptr<ElementPass>> PassManager::elementPasses() const
1542{
1543 Q_D(const PassManager);
1544 return d->m_elementPasses;
1545}
1546
1550std::multimap<QString, PropertyPassInfo> PassManager::propertyPasses() const
1551{
1552 Q_D(const PassManager);
1553 return d->m_propertyPasses;
1554}
1555
1559std::unordered_map<quint32, BindingInfo> PassManager::bindingsByLocation() const
1560{
1561 Q_D(const PassManager);
1562 return d->m_bindingsByLocation;
1563}
1564
1566
1569 const QString &replacement)
1570 : m_fixSuggestion{ fixDescription, QQmlSA::SourceLocationPrivate::sourceLocation(location),
1571 replacement },
1572 q_ptr{ interface }
1573{
1574}
1575
1578 : m_fixSuggestion{ other.m_fixSuggestion }, q_ptr{ interface }
1579{
1580}
1581
1583 : m_fixSuggestion{ std::move(other.m_fixSuggestion) }, q_ptr{ interface }
1584{
1585}
1586
1588{
1589 return m_fixSuggestion.fixDescription();
1590}
1591
1596
1598{
1599 return m_fixSuggestion.replacement();
1600}
1601
1603{
1604 m_fixSuggestion.setFilename(fileName);
1605}
1606
1608{
1609 return m_fixSuggestion.filename();
1610}
1611
1613{
1614 m_fixSuggestion.setHint(hint);
1615}
1616
1618{
1619 return m_fixSuggestion.hint();
1620}
1621
1623{
1624 m_fixSuggestion.setAutoApplicable(autoApplicable);
1625}
1626
1628{
1629 return m_fixSuggestion.isAutoApplicable();
1630}
1631
1633{
1634 return saFixSuggestion.d_func()->m_fixSuggestion;
1635}
1636
1638{
1639 return saFixSuggestion.d_func()->m_fixSuggestion;
1640}
1641
1651 const QString &replacement)
1652 : d_ptr{ new FixSuggestionPrivate{ this, fixDescription, location, replacement } }
1653{
1654}
1655
1657 : d_ptr{ new FixSuggestionPrivate{ this, *other.d_func() } }
1658{
1659}
1660
1662 : d_ptr{ new FixSuggestionPrivate{ this, std::move(*other.d_func()) } }
1663{
1664}
1665
1667{
1668 if (*this == other)
1669 return *this;
1670
1671 d_func()->m_fixSuggestion = other.d_func()->m_fixSuggestion;
1672 return *this;
1673}
1674
1676{
1677 if (*this == other)
1678 return *this;
1679
1680 d_func()->m_fixSuggestion = std::move(other.d_func()->m_fixSuggestion);
1681 return *this;
1682}
1683
1685
1690{
1691 return FixSuggestionPrivate::fixSuggestion(*this).fixDescription();
1692}
1693
1702
1707{
1708 return FixSuggestionPrivate::fixSuggestion(*this).replacement();
1709}
1710
1718
1723{
1724 return FixSuggestionPrivate::fixSuggestion(*this).filename();
1725}
1726
1731{
1733}
1734
1739{
1740 return FixSuggestionPrivate::fixSuggestion(*this).hint();
1741}
1742
1747void FixSuggestion::setAutoApplicable(bool autoApplicable)
1748{
1749 return FixSuggestionPrivate::fixSuggestion(*this).setAutoApplicable(autoApplicable);
1750}
1751
1756{
1757 return FixSuggestionPrivate::fixSuggestion(*this).isAutoApplicable();
1758}
1759
1760bool FixSuggestion::operatorEqualsImpl(const FixSuggestion &lhs, const FixSuggestion &rhs)
1761{
1762 return lhs.d_func()->m_fixSuggestion == rhs.d_func()->m_fixSuggestion;
1763}
1764
1765} // namespace QQmlSA
1766
static JNINativeMethod methods[]
\inmodule QtCore
QString toString() const
Returns a deep copy of this string view's data as a QString.
Definition qstring.h:1218
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
\inmodule QtCore
Definition qhash.h:1840
QVariant property(const char *name) const
Returns the value of the object's name property.
Definition qobject.cpp:4323
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
Definition qobject.h:348
QString filename() const
void setFilename(const QString &filename)
QQmlJS::SourceLocation location() const
QString hint() const
bool isAutoApplicable() const
QString replacement() const
QString fixDescription() const
void setHint(const QString &hint)
void setAutoApplicable(bool autoApply=true)
QQmlJSImporter * importer()
QQmlJS::SourceLocation sourceLocation() const
QString methodName() const
QQmlJSMetaMethodType methodType() const
QSharedPointer< const QQmlJSScope > type() const
QString typeName() const
static QQmlSA::Element createQQmlSAElement(const ConstPtr &)
static const QQmlJSScope::ConstPtr & scope(const QQmlSA::Element &)
static QString prettyName(QAnyStringView name)
static constexpr qsizetype sizeofQQmlSAElement()
static QQmlJSMetaPropertyBinding binding(QQmlSA::Binding &binding)
Definition qqmlsa.cpp:146
static QQmlSA::Binding createBinding(const QQmlJSMetaPropertyBinding &)
Definition qqmlsa.cpp:139
BindingPrivate(Binding *)
Definition qqmlsa.cpp:100
\inmodule QtQmlCompiler
Definition qqmlsa.h:57
QMultiHash< QString, Binding >::const_iterator constBegin() const
Returns an iterator to the beginning of the bindings.
Definition qqmlsa.cpp:66
QMultiHash< QString, Binding >::const_iterator constEnd() const
Returns an iterator to the end of the bindings.
Definition qqmlsa.cpp:80
\inmodule QtQmlCompiler
Definition qqmlsa.h:52
BindingType bindingType() const
Definition qqmlsa.cpp:165
bool hasUndefinedScriptValue() const
Definition qqmlsa.cpp:240
Binding & operator=(const Binding &)
Definition qqmlsa.cpp:107
bool hasObject() const
Returns true if this binding has an objects, otherwise returns false.
Definition qqmlsa.cpp:226
Element attachingType() const
Returns the attached type if the content type of this binding is AttachedProperty,...
Definition qqmlsa.cpp:191
static bool isLiteralBinding(BindingType)
Returns true if bindingType is a literal type, and false otherwise.
Definition qqmlsa.cpp:252
QString propertyName() const
Returns the name of the property bound with this binding.
Definition qqmlsa.cpp:182
QString stringValue() const
Returns the associated string literal if the content type of this binding is StringLiteral,...
Definition qqmlsa.cpp:174
Element objectType() const
Returns the type of the associated object if the content type of this binding is Object,...
Definition qqmlsa.cpp:235
QQmlSA::SourceLocation sourceLocation() const
Returns the location in the QML code where this binding is defined.
Definition qqmlsa.cpp:199
ScriptBindingKind scriptKind() const
Returns the kind of the associated script if the content type of this binding is Script,...
Definition qqmlsa.cpp:218
double numberValue() const
Returns the associated number if the content type of this binding is NumberLiteral,...
Definition qqmlsa.cpp:209
Element groupType() const
Returns the type of the property of this binding if it is a group property, otherwise returns an inva...
Definition qqmlsa.cpp:160
BindingsPrivate(QQmlSA::Binding::Bindings *)
Definition qqmlsa.cpp:44
QMultiHash< QString, Binding >::const_iterator constBegin() const
Definition qqmlsa.cpp:72
static QQmlSA::Binding::Bindings createBindings(const QMultiHash< QString, QQmlJSMetaPropertyBinding > &)
Definition qqmlsa.cpp:786
QMultiHash< QString, Binding >::const_iterator constEnd() const
Definition qqmlsa.cpp:86
void run(const Element &element) override
Executes if shouldRun() returns true.
Definition qqmlsa.cpp:1331
void onWrite(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &value, const QQmlSA::Element &writeScope, QQmlSA::SourceLocation location) override
Executes whenever a property is written to.
Definition qqmlsa.cpp:1526
void onBinding(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope, const QQmlSA::Element &value) override
Executes whenever a property gets bound to a value.
Definition qqmlsa.cpp:1503
DebugPropertyPass(QQmlSA::PassManager *manager)
Definition qqmlsa.cpp:1486
void onRead(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location) override
Executes whenever a property is read.
Definition qqmlsa.cpp:1490
virtual bool shouldRun(const Element &element)
Controls whether the run() function should be executed on the given element.
Definition qqmlsa.cpp:1421
\inmodule QtQmlCompiler
Definition qqmlsa.h:193
Element baseType() const
Returns the Element this Element derives from.
Definition qqmlsa.cpp:591
QString defaultPropertyName() const
Returns the name of the default property of this Element.
Definition qqmlsa.cpp:689
QQmlSA::SourceLocation sourceLocation() const
Returns the location in the QML code where this Element is defined.
Definition qqmlsa.cpp:721
bool isNull() const
Definition qqmlsa.cpp:620
Binding::Bindings ownPropertyBindings() const
Returns this Element's property bindings which are not defined on its base or extension objects.
Definition qqmlsa.cpp:756
QList< Binding > propertyBindings(const QString &propertyName) const
Returns this Element's property bindings that have the name propertyName.
Definition qqmlsa.cpp:774
bool isComposite() const
Returns true for objects defined from Qml, and false for objects declared from C++.
Definition qqmlsa.cpp:645
QString baseTypeName() const
Returns the name of the Element this Element derives from.
Definition qqmlsa.cpp:599
QQmlSA::SourceLocation location() const
Definition qqmlsa.cpp:1592
void setHint(const QString &)
Definition qqmlsa.cpp:1612
void setFileName(const QString &)
Definition qqmlsa.cpp:1602
QString fixDescription() const
Definition qqmlsa.cpp:1587
FixSuggestionPrivate(FixSuggestion *)
Definition qqmlsa.cpp:1565
void setAutoApplicable(bool autoApplicable=true)
Definition qqmlsa.cpp:1622
QString replacement() const
Definition qqmlsa.cpp:1597
static QQmlJSFixSuggestion & fixSuggestion(QQmlSA::FixSuggestion &)
Definition qqmlsa.cpp:1632
\inmodule QtQmlCompiler
Definition qqmlsa.h:386
FixSuggestion(const QString &fixDescription, const QQmlSA::SourceLocation &location, const QString &replacement=QString())
Definition qqmlsa.cpp:1650
void setHint(const QString &)
Sets hint as the hint for this fix suggestion.
Definition qqmlsa.cpp:1730
QString fileName() const
Returns the name of the file where this fix suggestion applies.
Definition qqmlsa.cpp:1722
FixSuggestion & operator=(const FixSuggestion &)
Definition qqmlsa.cpp:1666
void setFileName(const QString &)
Sets fileName as the name of the file where this fix suggestion applies.
Definition qqmlsa.cpp:1714
QString hint() const
Returns the hint for this fix suggestion.
Definition qqmlsa.cpp:1738
QString replacement() const
Returns the fix that will replace the problematic source code.
Definition qqmlsa.cpp:1706
QString fixDescription() const
Returns the description of the fix.
Definition qqmlsa.cpp:1689
QQmlSA::SourceLocation location() const
Returns the location where the fix would be applied.
Definition qqmlsa.cpp:1697
bool isAutoApplicable() const
Returns whether this suggested fix can be applied automatically.
Definition qqmlsa.cpp:1755
void setAutoApplicable(bool autoApplicable=true)
Sets autoApplicable to determine whether this suggested fix can be applied automatically.
Definition qqmlsa.cpp:1747
GenericPassPrivate(GenericPass *interface, PassManager *manager)
Definition qqmlsa.cpp:858
\inmodule QtQmlCompiler
Definition qqmlsa.h:272
void emitWarning(QAnyStringView diagnostic, LoggerWarningId id)
Emits a warning message diagnostic about an issue of type id.
Definition qqmlsa.cpp:881
Element resolveLiteralType(const Binding &binding)
Returns the element representing the type of literal in binding.
Definition qqmlsa.cpp:993
Element resolveBuiltinType(QAnyStringView typeName) const
Returns the type of the built-in type identified by typeName.
Definition qqmlsa.cpp:965
virtual ~GenericPass()
Element resolveAttached(QAnyStringView moduleName, QAnyStringView typeName)
Returns the attached type of typeName defined in module moduleName.
Definition qqmlsa.cpp:983
QString resolveElementToId(const Element &element, const Element &context)
Returns the id of element in a given context.
Definition qqmlsa.cpp:1016
Element resolveTypeInFileScope(QAnyStringView typeName)
Returns the type corresponding to typeName inside the currently analysed file.
Definition qqmlsa.cpp:919
QString sourceCode(QQmlSA::SourceLocation location)
Returns the source code located within location.
Definition qqmlsa.cpp:1027
Element resolveAttachedInFileScope(QAnyStringView typeName)
Returns the attached type corresponding to typeName used inside the currently analysed file.
Definition qqmlsa.cpp:931
Element resolveIdToElement(QAnyStringView id, const Element &context)
Returns the element in context that has id id.
Definition qqmlsa.cpp:1004
GenericPass(PassManager *manager)
Creates a generic pass.
Definition qqmlsa.cpp:875
Element resolveType(QAnyStringView moduleName, QAnyStringView typeName)
Returns the type of typeName defined in module moduleName.
Definition qqmlsa.cpp:949
\inmodule QtQmlCompiler
MethodPrivate(Method *)
Definition qqmlsa.cpp:305
QQmlSA::SourceLocation sourceLocation() const
Definition qqmlsa.cpp:317
static QQmlSA::Method createMethod(const QQmlJSMetaMethod &)
Definition qqmlsa.cpp:398
MethodType methodType() const
Definition qqmlsa.cpp:322
static QQmlJSMetaMethod method(const QQmlSA::Method &)
Definition qqmlsa.cpp:419
QString methodName() const
Definition qqmlsa.cpp:312
\inmodule QtQmlCompiler
Definition qqmlsa.h:116
QMultiHash< QString, Method >::const_iterator constBegin() const
Returns an iterator to the beginning of the methods.
Definition qqmlsa.cpp:269
QMultiHash< QString, Method >::const_iterator constEnd() const
Returns an iterator to the end of the methods.
Definition qqmlsa.cpp:283
\inmodule QtQmlCompiler
Definition qqmlsa.h:111
MethodType methodType() const
Returns the type of this method.
Definition qqmlsa.cpp:378
QQmlSA::SourceLocation sourceLocation() const
Returns the location in the QML code where this method is defined.
Definition qqmlsa.cpp:387
Method & operator=(const Method &)
Definition qqmlsa.cpp:343
QString methodName() const
Returns the name of the this method.
Definition qqmlsa.cpp:368
static QQmlSA::Method::Methods createMethods(const QMultiHash< QString, QQmlJSMetaMethod > &)
Definition qqmlsa.cpp:407
QMultiHash< QString, Method >::const_iterator constEnd() const
Definition qqmlsa.cpp:288
MethodsPrivate(QQmlSA::Method::Methods *)
Definition qqmlsa.cpp:293
QMultiHash< QString, Method >::const_iterator constBegin() const
Definition qqmlsa.cpp:275
void analyze(const Element &root)
Definition qqmlsa.cpp:1201
void registerElementPass(std::unique_ptr< ElementPass > pass)
PassManager::registerElementPass registers ElementPass with the pass manager.
Definition qqmlsa.cpp:1062
void addBindingSourceLocations(const QQmlSA::Element &element, const QQmlSA::Element &scope=QQmlSA::Element(), const QString prefix=QString(), bool isAttached=false)
Definition qqmlsa.cpp:1156
QQmlJSImportVisitor * m_visitor
Definition qqmlsa_p.h:234
static QQmlJSTypeResolver * resolver(const QQmlSA::PassManager &)
Definition qqmlsa.cpp:1292
void analyzeRead(const QQmlSA::Element &element, QString propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)
Definition qqmlsa.cpp:1227
QSet< PropertyPass * > findPropertyUsePasses(const QQmlSA::Element &element, const QString &propertyName)
Definition qqmlsa.cpp:1297
std::multimap< QString, PropertyPassInfo > m_propertyPasses
Definition qqmlsa_p.h:232
void analyzeBinding(const QQmlSA::Element &element, const QQmlSA::Element &value, QQmlSA::SourceLocation location)
Definition qqmlsa.cpp:1234
std::vector< std::shared_ptr< ElementPass > > m_elementPasses
Definition qqmlsa_p.h:231
void analyzeWrite(const QQmlSA::Element &element, QString propertyName, const QQmlSA::Element &value, const QQmlSA::Element &writeScope, QQmlSA::SourceLocation location)
Definition qqmlsa.cpp:1219
std::unordered_map< quint32, BindingInfo > m_bindingsByLocation
Definition qqmlsa_p.h:233
static QQmlJSImportVisitor * visitor(const QQmlSA::PassManager &)
Definition qqmlsa.cpp:1287
bool registerPropertyPass(std::shared_ptr< PropertyPass > pass, QAnyStringView moduleName, QAnyStringView typeName, QAnyStringView propertyName=QAnyStringView(), bool allowInheritance=true)
Definition qqmlsa.cpp:1127
\inmodule QtQmlCompiler
Definition qqmlsa.h:303
void analyze(const Element &root)
Runs the element passes over root and all its children.
Definition qqmlsa.cpp:1185
std::multimap< QString, PropertyPassInfo > propertyPasses() const
Returns the list of property passes.
Definition qqmlsa.cpp:1550
bool isCategoryEnabled(LoggerWarningId category) const
Returns true if warnings of category are enabled, false otherwise.
Definition qqmlsa.cpp:1282
bool registerPropertyPass(std::shared_ptr< PropertyPass > pass, QAnyStringView moduleName, QAnyStringView typeName, QAnyStringView propertyName=QAnyStringView(), bool allowInheritance=true)
Registers a static analysis pass for properties.
Definition qqmlsa.cpp:1119
void registerElementPass(std::unique_ptr< ElementPass > pass)
Registers a static analysis pass to be run on all elements.
Definition qqmlsa.cpp:1050
std::unordered_map< quint32, BindingInfo > bindingsByLocation() const
Returns bindings by their source location.
Definition qqmlsa.cpp:1559
std::vector< std::shared_ptr< ElementPass > > elementPasses() const
Returns the list of element passes.
Definition qqmlsa.cpp:1541
bool hasImportedModule(QAnyStringView name) const
Returns true if the module named module has been imported by the QML to be analyzed,...
Definition qqmlsa.cpp:1274
\inmodule QtQmlCompiler
Definition qqmlsa.h:342
PropertyPass(PassManager *manager)
Definition qqmlsa.cpp:1435
virtual void onWrite(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &value, const QQmlSA::Element &writeScope, QQmlSA::SourceLocation location)
Executes whenever a property is written to.
Definition qqmlsa.cpp:1475
virtual void onRead(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)
Executes whenever a property is read.
Definition qqmlsa.cpp:1459
virtual void onBinding(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope, const QQmlSA::Element &value)
Executes whenever a property gets bound to a value.
Definition qqmlsa.cpp:1442
static QQmlSA::Property createProperty(const QQmlJSMetaProperty &)
Definition qqmlsa.cpp:469
static QQmlJSMetaProperty property(const QQmlSA::Property &property)
Definition qqmlsa.cpp:464
QQmlSA::Element type() const
Returns the type that this property was defined with.
Definition qqmlsa.cpp:459
bool isValid() const
Definition qqmlsa.cpp:441
PropertyPrivate(Property *)
Definition qqmlsa.cpp:424
QString typeName() const
Definition qqmlsa.cpp:436
bool isReadonly() const
Returns whether this property is readonly.
Definition qqmlsa.cpp:451
\inmodule QtQmlCompiler
Definition qqmlsa.h:160
bool isValid() const
Definition qqmlsa.cpp:525
QString typeName() const
Returns the name of the type of this property.
Definition qqmlsa.cpp:519
bool isReadonly() const
Definition qqmlsa.cpp:531
QQmlSA::Element type() const
Definition qqmlsa.cpp:537
Property & operator=(const Property &)
Definition qqmlsa.cpp:494
static const QQmlJS::SourceLocation & sourceLocation(const QQmlSA::SourceLocation &sourceLocation)
static QQmlSA::SourceLocation createQQmlSASourceLocation(const QQmlJS::SourceLocation &jsLocation)
\inmodule QtQmlCompiler
bool isEmpty() const
Definition qset.h:52
bool contains(const T &value) const
Definition qset.h:71
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition qstring.cpp:5506
QString & insert(qsizetype i, QChar c)
Definition qstring.cpp:3132
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:8084
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
#define this
Definition dialogs.cpp:9
const QLoggingCategory & category()
[1]
QHash< int, QWidget * > hash
[35multi]
QSet< QString >::iterator it
\inmodule QtQmlCompiler
MethodType
Definition qqmlsa.h:49
@ Register
Definition qqmlsa.cpp:1067
static QQmlJS::ConstPtrWrapperIterator childScopesBegin(const Element &element)
Definition qqmlsa.cpp:1191
static QQmlJS::ConstPtrWrapperIterator childScopesEnd(const Element &element)
Definition qqmlsa.cpp:1196
AccessSemantics
Definition qqmlsa_p.h:40
static QString lookupName(const QQmlSA::Element &element, LookupMode mode=Lookup)
Definition qqmlsa.cpp:1068
Combined button and popup list for selecting options.
static void * context
std::pair< T1, T2 > QPair
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 return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
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 * interface
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
static QString methodName(const QDBusIntrospection::Method &method)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
#define qWarning
Definition qlogging.h:166
const char * typeName
GLint location
GLenum mode
GLuint64 key
GLuint GLuint end
GLenum type
GLenum GLuint GLintptr offset
GLuint name
static QString internalName(const QQmlJSScope::ConstPtr &scope)
const QQmlSA::LoggerWarningId qmlPlugin
@ ScriptValue_Undefined
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QWidget Element
Definition main.cpp:7
#define Q_UNUSED(x)
ptrdiff_t qsizetype
Definition qtypes.h:165
const char property[13]
Definition qwizard.cpp:101
QSharedPointer< T > other(t)
[5]
QNetworkAccessManager manager
QHostInfo info
[0]
char * toString(const MyType &t)
[31]
static bool searchBaseAndExtensionTypes(QQmlJSScopePtr type, const Action &check)