16#include <QtQmlCompiler/qqmlsaconstants.h>
17#include <QtQmlCompiler/qqmljsloggingutils.h>
19#include <QtQmlCompiler/qtqmlcompilerexports.h>
21#include <QtCore/qhash.h>
22#include <QtCore/qsharedpointer.h>
23#include <QtCore/qplugin.h>
24#include <QtQmlCompiler/qqmlsasourcelocation.h>
26#include <unordered_map>
37class FixSuggestionPrivate;
38class GenericPassPrivate;
42class PassManagerPrivate;
47struct PropertyPassInfo;
71 std::unique_ptr<BindingsPrivate> d_ptr;
87 double numberValue() const;
89 bool hasObject() const;
91 bool hasUndefinedScriptValue() const;
95 return operatorEqualsImpl(lhs, rhs);
99 return !operatorEqualsImpl(lhs, rhs);
107 std::unique_ptr<BindingPrivate> d_ptr;
130 std::unique_ptr<MethodsPrivate> d_ptr;
146 return operatorEqualsImpl(lhs, rhs);
150 return !operatorEqualsImpl(lhs, rhs);
154 static bool operatorEqualsImpl(
const Method &,
const Method &);
156 std::unique_ptr<MethodPrivate> d_ptr;
172 bool isValid()
const;
173 bool isReadonly()
const;
178 return operatorEqualsImpl(lhs, rhs);
183 return !operatorEqualsImpl(lhs, rhs);
189 std::unique_ptr<PropertyPrivate> d_ptr;
194 friend class QT_PREPEND_NAMESPACE(QQmlJSScope);
202 memset(
other.m_data, 0, sizeofElement);
205 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(
Element)
219 bool hasProperty(
const QString &propertyName)
const;
220 bool hasOwnProperty(
const QString &propertyName)
const;
222 bool isPropertyRequired(
const QString &propertyName)
const;
223 QString defaultPropertyName()
const;
231 bool hasPropertyBindings(
const QString &
name)
const;
232 bool hasOwnPropertyBindings(
const QString &propertyName)
const;
236 QList<Binding> propertyBindings(
const QString &propertyName)
const;
238 explicit operator bool()
const;
239 bool operator!()
const;
245 return operatorEqualsImpl(lhs, rhs);
258 static constexpr qsizetype sizeofElement = 2 *
sizeof(QSharedPointer<int>);
259 alignas(QSharedPointer<int>)
char m_data[sizeofElement];
263 char t[sizeofElement];
264 memcpy(
t,
m_data, sizeofElement);
266 memcpy(
other.m_data,
t, sizeofElement);
299 std::unique_ptr<GenericPassPrivate> d_ptr;
308 void registerElementPass(std::unique_ptr<ElementPass> pass);
309 bool registerPropertyPass(std::shared_ptr<PropertyPass> pass,
QAnyStringView moduleName,
312 bool allowInheritance =
true);
313 void analyze(
const Element &root);
319 std::vector<std::shared_ptr<ElementPass>> elementPasses()
const;
320 std::multimap<QString, PropertyPassInfo> propertyPasses()
const;
321 std::unordered_map<quint32, BindingInfo> bindingsByLocation()
const;
327 std::unique_ptr<PassManagerPrivate> d_ptr;
361 virtual bool shouldRun(
const Element &element);
367 void run(
const Element &element)
override;
398 QString fixDescription()
const;
408 void setAutoApplicable(
bool autoApplicable =
true);
409 bool isAutoApplicable()
const;
413 return operatorEqualsImpl(lhs, rhs);
418 return !operatorEqualsImpl(lhs, rhs);
424 std::unique_ptr<FixSuggestionPrivate> d_ptr;
429#define QmlLintPluginInterface_iid "org.qt-project.Qt.Qml.SA.LintPlugin/1.0"
QMultiHash< QString, Binding >::const_iterator begin() const
QMultiHash< QString, Binding >::const_iterator end() const
friend bool operator!=(const Binding &lhs, const Binding &rhs)
virtual void run(const Element &element)=0
Executes if shouldRun() returns true.
ElementPass(PassManager *manager)
friend void swap(Element &lhs, Element &rhs) noexcept
friend bool operator!=(const Element &lhs, const Element &rhs)
Element(Element &&other) noexcept
friend qsizetype qHash(const Element &key, qsizetype seed=0) noexcept
friend bool operator==(const QQmlSA::Element &lhs, const QQmlSA::Element &rhs)
friend bool operator==(const FixSuggestion &lhs, const FixSuggestion &rhs)
friend bool operator!=(const FixSuggestion &lhs, const FixSuggestion &rhs)
virtual ~LintPlugin()=default
QMultiHash< QString, Method >::const_iterator end() const
QMultiHash< QString, Method >::const_iterator begin() const
friend bool operator!=(const Method &lhs, const Method &rhs)
friend bool operator==(const Property &lhs, const Property &rhs)
friend bool operator!=(const Property &lhs, const Property &rhs)
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QLoggingCategory & category()
[1]
Combined button and popup list for selecting options.
static QString methodName(const QDBusIntrospection::Method &method)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_INTERFACE(IFace, IId)
static bool isComposite(const QQmlJSScope::ConstPtr &scope)
#define QmlLintPluginInterface_iid
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
file setFileName("readme.txt")
QNetworkAccessManager manager