Auf dieser Seite

QQmlSA::SourceLocation Class

class QQmlSA::SourceLocation

Bezeichnet eine Stelle oder einen Bereich im Quellcode. Mehr...

Header: #include <qqmlsasourcelocation.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
Status: Technologievorschau

Diese Klasse befindet sich in der Technologievorschau und kann sich noch ändern.

Öffentliche Funktionen

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)

Statische öffentliche Mitglieder

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

Ausführliche Beschreibung

Dokumentation der Mitgliedsfunktionen

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

Erstellt einen neuen `SourceLocation`-Objekt mit den Werten aus offset, length, line und column.

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

Erstellt eine Kopie von „ other “.

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

Erstellt ein „SourceLocation“-Objekt aus „ other “.

[noexcept] SourceLocation::~SourceLocation()

Löscht diese SourceLocation -Instanz.

quint32 SourceLocation::begin() const

Gibt den Offset des Anfangs dieser Quellstelle zurück.

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

Gibt den Quellort des Ursprungs eines beliebigen QML-Dokuments zurück.

Diese Funktion wurde in Qt 6.12 eingeführt.

quint32 SourceLocation::end() const

Gibt den Offset des Endes dieses Quellbereichs zurück.

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

Gibt einen Quellort der Länge Null zurück, der auf das Ende dieses Quellorts verweist, der wiederum auf text verweist.

bool SourceLocation::isValid() const

Gibt „ true “ zurück, wenn „ SourceLocation “ gültig ist, andernfalls „ false “.

quint32 SourceLocation::length() const

Gibt die Länge dieses Quellorts zurück.

quint32 SourceLocation::offset() const

Gibt den Offset vom Anfang dieser Quellstelle zurück.

quint32 SourceLocation::startColumn() const

Gibt die Spaltennummer zurück, die den Anfang dieser Quelle enthält.

quint32 SourceLocation::startLine() const

Gibt die Zeilennummer zurück, in der der Anfang dieser Quellstelle steht.

QQmlSA::SourceLocation SourceLocation::startZeroLengthLocation() const

Gibt eine Quellposition der Länge Null zurück, die auf den Anfang dieser Quellposition verweist.

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

Weist „ other “ diesem „ SourceLocation “ zu.

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

Weist „ other “ diesem „ SourceLocation “ zu.

Verwandte Nichtmitglieder

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

Gibt den Hash-Wert für location zurück, wobei seed als Startwert für die Berechnung verwendet wird.

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

Gibt „true“ zurück, wenn lhs nicht mit rhs übereinstimmt, andernfalls false. Unter SourceLocation::operator== erfahren Sie, wann zwei Quelladressen als identisch gelten.

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

Gibt „true“ zurück, wenn „ lhs “ gleich „ rhs “ ist, andernfalls „ false “. Zwei „SourceLocations“ gelten als gleich, wenn sie für die Elemente „offset“, „length“, „line“ und „column“ dieselben Werte aufweisen.

© 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.