Nesta página

QQmlSA::SourceLocation Class

class QQmlSA::SourceLocation

Representa um local ou região no código-fonte. Mais...

Cabeçalho: #include <qqmlsasourcelocation.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
Status: Pré-visualização tecnológica

Esta classe está em pré-visualização tecnológica e está sujeita a alterações.

Funções públicas

SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
SourceLocation(const QQmlSA::SourceLocation &other)
SourceLocation(QQmlSA::SourceLocation &&other)
~SourceLocation()
quint32 begin() const
quint32 end() const
QQmlSA::SourceLocation endZeroLengthLocation(QStringView text) const
bool isValid() const
quint32 length() const
quint32 offset() const
quint32 startColumn() const
quint32 startLine() const
QQmlSA::SourceLocation startZeroLengthLocation() const
QQmlSA::SourceLocation &operator=(QQmlSA::SourceLocation &&other)
QQmlSA::SourceLocation &operator=(const QQmlSA::SourceLocation &other)

Membros públicos estáticos

(since 6.12) QQmlSA::SourceLocation documentOrigin()
qsizetype qHash(const QQmlSA::SourceLocation &location, qsizetype seed = 0)
bool operator!=(const QQmlSA::SourceLocation &lhs, const QQmlSA::SourceLocation &rhs)
bool operator==(const QQmlSA::SourceLocation &lhs, const QQmlSA::SourceLocation &rhs)

Descrição detalhada

Documentação das funções de membro

[explicit] SourceLocation::SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)

Cria um novo `SourceLocation` com os valores fornecidos por offset, length, line e column.

SourceLocation::SourceLocation(const QQmlSA::SourceLocation &other)

Cria uma cópia de other.

[noexcept] SourceLocation::SourceLocation(QQmlSA::SourceLocation &&other)

Move — Cria um `SourceLocation` a partir de um ` other`.

[noexcept] SourceLocation::~SourceLocation()

Destrui esta instância de ` SourceLocation `.

quint32 SourceLocation::begin() const

Retorna o deslocamento do início desta localização de origem.

[static, since 6.12] QQmlSA::SourceLocation SourceLocation::documentOrigin()

Retorna a localização de origem de qualquer documento QML.

Essa função foi introduzida no Qt 6.12.

quint32 SourceLocation::end() const

Retorna o deslocamento do final desta localização de origem.

QQmlSA::SourceLocation SourceLocation::endZeroLengthLocation(QStringView text) const

Retorna uma localização de origem de comprimento zero que aponta para o final dessa localização de origem, que, por sua vez, aponta para text.

bool SourceLocation::isValid() const

Retorna ` true ` se ` SourceLocation ` for válido; caso contrário, retorna ` false `.

quint32 SourceLocation::length() const

Retorna o comprimento deste local de origem.

quint32 SourceLocation::offset() const

Retorna o deslocamento do início desta localização de origem.

quint32 SourceLocation::startColumn() const

Retorna o número da coluna que contém o início desta localização de origem.

quint32 SourceLocation::startLine() const

Retorna o número da linha que contém o início desta localização na fonte.

QQmlSA::SourceLocation SourceLocation::startZeroLengthLocation() const

Retorna uma localização de origem de comprimento zero que aponta para o início dessa localização de origem.

[noexcept] QQmlSA::SourceLocation &SourceLocation::operator=(QQmlSA::SourceLocation &&other)

A função “Move” atribui other a este SourceLocation.

QQmlSA::SourceLocation &SourceLocation::operator=(const QQmlSA::SourceLocation &other)

Atribui other a este SourceLocation.

Não-membros relacionados

qsizetype qHash(const QQmlSA::SourceLocation &location, qsizetype seed = 0)

Retorna o valor hash para location, utilizando seed como semente para o cálculo.

bool operator!=(const QQmlSA::SourceLocation &lhs, const QQmlSA::SourceLocation &rhs)

Retorna `true` se ` lhs ` não for igual a ` rhs`, e ` false ` caso contrário. Consulte SourceLocation::operator== para saber quando dois locais de origem são considerados iguais.

bool operator==(const QQmlSA::SourceLocation &lhs, const QQmlSA::SourceLocation &rhs)

Retorna “true” se lhs for igual a rhs e, caso contrário, false. Dois SourceLocations são considerados iguais se tiverem os mesmos valores para seus membros offset, length, line e column.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.