内容表

上一话题

QAbstractXmlReceiver

下一话题

QXmlFormatter

QSourceLocation

QSourceLocation class identifies a location in a resource by URI, line, and column. 更多

Inheritance diagram of PySide2.QtXmlPatterns.QSourceLocation

概要

函数

详细描述

QSourceLocation is a simple value based class that has three properties, uri() , line() ,和 column() , that, taken together, identify a certain point in a resource, e.g., a file or an in-memory document.

line() and column() refer to character counts (not byte counts), and they both start from 1, as opposed to 0.

class QSourceLocation

QSourceLocation(other)

QSourceLocation(uri[, line=-1[, column=-1]])

param uri

QUrl

param column

int

param other

QSourceLocation

param line

int

构造 QSourceLocation that doesn’t identify anything at all.

For a default constructed , isNull() 返回 true .

构造 QSourceLocation that is a copy of other .

构造 QSourceLocation with URI u , line l and column c .

PySide2.QtXmlPatterns.QSourceLocation. column ( )
返回类型

qint64

Returns the current column number. The column number refers to the count of characters, not bytes. The first column is column 1, not 0. The default value is -1, indicating the column number is unknown.

另请参阅

setColumn()

PySide2.QtXmlPatterns.QSourceLocation. isNull ( )
返回类型

bool

返回 true 若此 QSourceLocation doesn’t identify anything.

For a default constructed QSourceLocation ,此函数返回 true . The same applies for any other QSourceLocation whose uri() is invalid.

PySide2.QtXmlPatterns.QSourceLocation. line ( )
返回类型

qint64

Returns the current line number. The first line number is 1, not 0. The default value is -1, indicating the line number is unknown.

另请参阅

setLine()

PySide2.QtXmlPatterns.QSourceLocation. __ne__ ( other )
参数

other QSourceLocation

返回类型

bool

返回 true 若此 QSourceLocation is not equal to other ; false 否则。

PySide2.QtXmlPatterns.QSourceLocation. __eq__ ( other )
参数

other QSourceLocation

返回类型

bool

返回 true 若此 QSourceLocation 等于 other ; false 否则。

Two QSourceLocation instances are equal if their uri() , line() and column() are equal.

QSourceLocation instances for which isNull() returns true are considered equal.

PySide2.QtXmlPatterns.QSourceLocation. setColumn ( newColumn )
参数

newColumn qint64

Sets the column number to newColumn . 0 is an invalid column number. The first column number is 1.

另请参阅

column()

PySide2.QtXmlPatterns.QSourceLocation. setLine ( newLine )
参数

newLine qint64

Sets the line number to newLine . 0 is an invalid line number. The first line number is 1.

另请参阅

line()

PySide2.QtXmlPatterns.QSourceLocation. setUri ( newUri )
参数

newUri QUrl

Sets the URI to newUri .

另请参阅

uri()

PySide2.QtXmlPatterns.QSourceLocation. uri ( )
返回类型

QUrl

Returns the resource that this QSourceLocation refers to. For example, the resource could be a file in the local file system, if the URI scheme is file .

另请参阅

setUri()