En esta página

QQmlSA::SourceLocation Class

class QQmlSA::SourceLocation

Representa una ubicación o región en el código fuente. Más información...

Encabezado: #include <qqmlsasourcelocation.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
Estado: Versión preliminar tecnológica

Esta clase se encuentra en fase de vista previa tecnológica y está sujeta a cambios.

Funciones 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)

Miembros 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)

Descripción detallada

Documentación de funciones de miembro

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

Crea un nuevo objeto `SourceLocation` con los valores proporcionados por offset, length, line y column.

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

Crea una copia de other.

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

Move: crea un objeto `SourceLocation` a partir de ` other`.

[noexcept] SourceLocation::~SourceLocation()

Destruye esta instancia de ` SourceLocation `.

quint32 SourceLocation::begin() const

Devuelve el desplazamiento desde el inicio de esta ubicación de origen.

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

Devuelve la ubicación de origen de cualquier documento QML.

Esta función se introdujo en Qt 6.12.

quint32 SourceLocation::end() const

Devuelve el desplazamiento del final de esta ubicación de origen.

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

Devuelve una ubicación de origen de longitud cero que apunta al final de esta ubicación de origen, que a su vez apunta a text.

bool SourceLocation::isValid() const

Devuelve « true » si « SourceLocation » es válido, y « false » en caso contrario.

quint32 SourceLocation::length() const

Devuelve la longitud de esta ubicación de origen.

quint32 SourceLocation::offset() const

Devuelve la posición inicial de esta ubicación de origen.

quint32 SourceLocation::startColumn() const

Devuelve el número de columna en la que se encuentra el inicio de esta ubicación de origen.

quint32 SourceLocation::startLine() const

Devuelve el número de línea en la que se encuentra el inicio de esta ubicación del código fuente.

QQmlSA::SourceLocation SourceLocation::startZeroLengthLocation() const

Devuelve una ubicación de origen de longitud cero que apunta al principio de dicha ubicación de origen.

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

Asigna other a este SourceLocation.

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

Asigna « other » a este « SourceLocation ».

Personas relacionadas que no son miembros

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

Devuelve el valor hash de location, utilizando seed como semilla para el cálculo.

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

Devuelve «true» si lhs no es igual a rhs, y false en caso contrario. Consulta SourceLocation::operator== para saber cuándo se consideran iguales dos ubicaciones de origen.

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

Devuelve «true» si lhs es igual a rhs, y false en caso contrario. Se considera que dos SourceLocations son iguales si tienen los mismos valores para sus miembros offset, length, line y 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.