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
AttachedPropertyReuse Class Reference

#include <quicklintplugin.h>

+ Inheritance diagram for AttachedPropertyReuse:
+ Collaboration diagram for AttachedPropertyReuse:

Public Types

enum  Mode { CheckAll , RestrictToControls }
 

Public Member Functions

 AttachedPropertyReuse (QQmlSA::PassManager *manager, QQmlSA::LoggerWarningId category)
 
void onRead (const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location) override
 Executes whenever a property is read.
 
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.
 
- Public Member Functions inherited from QQmlSA::PropertyPass
 PropertyPass (PassManager *manager)
 
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.
 
- Public Member Functions inherited from QQmlSA::GenericPass
 GenericPass (PassManager *manager)
 Creates a generic pass.
 
virtual ~GenericPass ()
 
void emitWarning (QAnyStringView diagnostic, LoggerWarningId id)
 Emits a warning message diagnostic about an issue of type id.
 
void emitWarning (QAnyStringView diagnostic, LoggerWarningId id, QQmlSA::SourceLocation srcLocation)
 Emits warning message diagnostic about an issue of type id located at srcLocation.
 
void emitWarning (QAnyStringView diagnostic, LoggerWarningId id, QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)
 Emits a warning message diagnostic about an issue of type id located at srcLocation and with suggested fix fix.
 
Element resolveTypeInFileScope (QAnyStringView typeName)
 Returns the type corresponding to typeName inside the currently analysed file.
 
Element resolveAttachedInFileScope (QAnyStringView typeName)
 Returns the attached type corresponding to typeName used inside the currently analysed file.
 
Element resolveType (QAnyStringView moduleName, QAnyStringView typeName)
 Returns the type of typeName defined in module moduleName.
 
Element resolveBuiltinType (QAnyStringView typeName) const
 Returns the type of the built-in type identified by typeName.
 
Element resolveAttached (QAnyStringView moduleName, QAnyStringView typeName)
 Returns the attached type of typeName defined in module moduleName.
 
Element resolveLiteralType (const Binding &binding)
 Returns the element representing the type of literal in binding.
 
Element resolveIdToElement (QAnyStringView id, const Element &context)
 Returns the element in context that has id id.
 
QString resolveElementToId (const Element &element, const Element &context)
 Returns the id of element in a given context.
 
QString sourceCode (QQmlSA::SourceLocation location)
 Returns the source code located within location.
 

Detailed Description

Definition at line 155 of file quicklintplugin.h.

Member Enumeration Documentation

◆ Mode

Enumerator
CheckAll 
RestrictToControls 

Definition at line 158 of file quicklintplugin.h.

Constructor & Destructor Documentation

◆ AttachedPropertyReuse()

AttachedPropertyReuse::AttachedPropertyReuse ( QQmlSA::PassManager * manager,
QQmlSA::LoggerWarningId category )
inline

Definition at line 163 of file quicklintplugin.h.

References category().

+ Here is the call graph for this function:

Member Function Documentation

◆ onRead()

void AttachedPropertyReuse::onRead ( const QQmlSA::Element & element,
const QString & propertyName,
const QQmlSA::Element & readScope,
QQmlSA::SourceLocation location )
overridevirtual

Executes whenever a property is read.

The property propertyName of element is read by an instruction within readScope defined at location.

Reimplemented from QQmlSA::PropertyPass.

Definition at line 510 of file quicklintplugin.cpp.

References QQmlSA::Element::baseType(), QQmlSA::GenericPass::emitWarning(), QMultiHash< Key, T >::equal_range(), QQmlSA::Element::hasMethod(), QQmlSA::Element::hasProperty(), QMultiHash< Key, T >::insert(), it, QQmlSA::Element::name(), QQmlSA::SourceLocation::offset(), QQmlSA::Element::parentScope(), quickControlsAttachedPropertyReuse, QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveElementToId(), QQmlSA::GenericPass::resolveTypeInFileScope(), and QQmlSA::FixSuggestion::setHint().

Referenced by onWrite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWrite()

void AttachedPropertyReuse::onWrite ( const QQmlSA::Element & element,
const QString & propertyName,
const QQmlSA::Element & value,
const QQmlSA::Element & writeScope,
QQmlSA::SourceLocation location )
overridevirtual

Executes whenever a property is written to.

The property propertyName of element is written to by an instruction within writeScope defined at location. The type of the expression written to propertyName is expressionType.

Reimplemented from QQmlSA::PropertyPass.

Definition at line 583 of file quicklintplugin.cpp.

References onRead(), and Q_UNUSED.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: