Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQmlJSScopesById Class Reference

#include <qqmljsscopesbyid_p.h>

Collaboration diagram for QQmlJSScopesById:

Classes

struct  CertainCallback
struct  MostLikelyCallback

Public Types

enum class  Confidence : quint8 { Certain , Possible }
enum class  CallbackResult : bool { StopSearch = false , ContinueSearch = true }
enum class  Success : bool { No = false , Yes = true }

Public Member Functions

bool componentsAreBound () const
void setComponentsAreBound (bool bound)
void setSignaturesAreEnforced (bool enforced)
bool signaturesAreEnforced () const
void setValueTypesAreAddressable (bool addressable)
bool valueTypesAreAddressable () const
template<typename F>
Success possibleIds (const QQmlJSScope::ConstPtr &scope, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options, F &&callback) const
QString id (const QQmlJSScope::ConstPtr &scope, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options=Default) const
template<typename F>
Success possibleScopes (const QString &id, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options, F &&callback) const
QQmlJSScope::ConstPtr scope (const QString &id, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options=Default) const
void insert (const QString &id, const QQmlJSScope::ConstPtr &scope)
void clear ()
bool existsAnywhereInDocument (const QString &id) const

Detailed Description

Definition at line 32 of file qqmljsscopesbyid_p.h.

Member Enumeration Documentation

◆ CallbackResult

enum class QQmlJSScopesById::CallbackResult : bool
strong
Enumerator
StopSearch 
ContinueSearch 

Definition at line 36 of file qqmljsscopesbyid_p.h.

◆ Confidence

enum class QQmlJSScopesById::Confidence : quint8
strong
Enumerator
Certain 
Possible 

Definition at line 35 of file qqmljsscopesbyid_p.h.

◆ Success

enum class QQmlJSScopesById::Success : bool
strong
Enumerator
No 
Yes 

Definition at line 37 of file qqmljsscopesbyid_p.h.

Member Function Documentation

◆ clear()

void QQmlJSScopesById::clear ( )
inline

Definition at line 243 of file qqmljsscopesbyid_p.h.

◆ componentsAreBound()

bool QQmlJSScopesById::componentsAreBound ( ) const
inline

Definition at line 72 of file qqmljsscopesbyid_p.h.

◆ existsAnywhereInDocument()

bool QQmlJSScopesById::existsAnywhereInDocument ( const QString & id) const
inline

Returns true if id exists anywhere in the current document. This is still allowed if the other occurrence is in a different (inline) component. Check the return value of scope to know whether the id has already been assigned in a givne scope.

Definition at line 252 of file qqmljsscopesbyid_p.h.

◆ id()

QString QQmlJSScopesById::id ( const QQmlJSScope::ConstPtr & scope,
const QQmlJSScope::ConstPtr & referrer,
QQmlJSScopesByIdOptions options = Default ) const
inline

Returns the id of scope in the component to which referrer belongs to. If scope is not visible from referrer or has no ID, an empty string is returned. An empty string is also returned if we can't determine the component boundaries for either scope or referrer.

Definition at line 139 of file qqmljsscopesbyid_p.h.

References Yes.

◆ insert()

void QQmlJSScopesById::insert ( const QString & id,
const QQmlJSScope::ConstPtr & scope )
inline

Definition at line 237 of file qqmljsscopesbyid_p.h.

◆ possibleIds()

template<typename F>
Success QQmlJSScopesById::possibleIds ( const QQmlJSScope::ConstPtr & scope,
const QQmlJSScope::ConstPtr & referrer,
QQmlJSScopesByIdOptions options,
F && callback ) const
inline

Find the possible IDs for scope as seen by referrer. There can be at most one ID for a scope. Depending on whether we can determine the component boundaries of the scope and the referrer we may or may not be able to tell whether it's visible.

We can generally determine the relevant component boundaries for each scope. However, if the scope or any of its parents is assigned to a property of which we cannot see the type, we don't know whether the type of that property happens to be Component. In that case, we can't say.

Returns Success::Yes if either no ID was found or the callback returned CallbackResult::ContinueSearch for the ID found. Returns Success::No if the callback returned CallbackResult::StopSearch.

Definition at line 97 of file qqmljsscopesbyid_p.h.

References ContinueSearch, No, StopSearch, and Yes.

◆ possibleScopes()

template<typename F>
Success QQmlJSScopesById::possibleScopes ( const QString & id,
const QQmlJSScope::ConstPtr & referrer,
QQmlJSScopesByIdOptions options,
F && callback ) const
inline

Find all possible scopes for id as seen by referrer. There can be multiple possibilities if we cannot determine component boundaries for any candidate or the referrer.

We can generally determine the relevant component boundaries for each scope. However, if the scope or any of its parents is assigned to a property of which we cannot see the type, we don't know whether the type of that property happens to be Component. In that case, we can't say.

Returns Success::Yes if either no suitable scope was found or the callback returned CallbackResult::ContinueSearch for all scopes found. Returns Success::No if the callback returns CallbackResult::StopSearch for any scope found. It also stops the search at that point.

Definition at line 169 of file qqmljsscopesbyid_p.h.

References ContinueSearch, No, StopSearch, and Yes.

◆ scope()

QQmlJSScope::ConstPtr QQmlJSScopesById::scope ( const QString & id,
const QQmlJSScope::ConstPtr & referrer,
QQmlJSScopesByIdOptions options = Default ) const
inline

Returns the scope that has id id in the component to which referrer belongs to. If no such scope exists, a null scope is returned. A null scope is also returned if we cannot determine the component boundaries for any candidate or the referrer.

Definition at line 224 of file qqmljsscopesbyid_p.h.

References Yes.

◆ setComponentsAreBound()

void QQmlJSScopesById::setComponentsAreBound ( bool bound)
inline

Definition at line 73 of file qqmljsscopesbyid_p.h.

◆ setSignaturesAreEnforced()

void QQmlJSScopesById::setSignaturesAreEnforced ( bool enforced)
inline

Definition at line 75 of file qqmljsscopesbyid_p.h.

◆ setValueTypesAreAddressable()

void QQmlJSScopesById::setValueTypesAreAddressable ( bool addressable)
inline

Definition at line 78 of file qqmljsscopesbyid_p.h.

◆ signaturesAreEnforced()

bool QQmlJSScopesById::signaturesAreEnforced ( ) const
inline

Definition at line 76 of file qqmljsscopesbyid_p.h.

◆ valueTypesAreAddressable()

bool QQmlJSScopesById::valueTypesAreAddressable ( ) const
inline

Definition at line 79 of file qqmljsscopesbyid_p.h.


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