QSourceLocation¶
The
QSourceLocationclass identifies a location in a resource by URI, line, and column. More…

Synopsis¶
Functions¶
Detailed Description¶
QSourceLocationis a simple value based class that has three properties,uri(),line(), andcolumn(), that, taken together, identify a certain point in a resource, e.g., a file or an in-memory document.
line()andcolumn()refer to character counts (not byte counts), and they both start from 1, as opposed to 0.
- class PySide2.QtXmlPatterns.QSourceLocation¶
PySide2.QtXmlPatterns.QSourceLocation(other)
PySide2.QtXmlPatterns.QSourceLocation(uri[, line=-1[, column=-1]])
- param uri:
- param column:
int
- param other:
- param line:
int
Construct a
QSourceLocationthat doesn’t identify anything at all.For a default constructed ,
isNull()returnstrue.Constructs a
QSourceLocationthat is a copy ofother.Constructs a
QSourceLocationwith URIu, lineland columnc.
- PySide2.QtXmlPatterns.QSourceLocation.column()¶
- Return type:
int
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.
See also
- PySide2.QtXmlPatterns.QSourceLocation.isNull()¶
- Return type:
bool
Returns
trueif thisQSourceLocationdoesn’t identify anything.For a default constructed
QSourceLocation, this function returnstrue. The same applies for any otherQSourceLocationwhoseuri()is invalid.
- PySide2.QtXmlPatterns.QSourceLocation.line()¶
- Return type:
int
Returns the current line number. The first line number is 1, not 0. The default value is -1, indicating the line number is unknown.
See also
- PySide2.QtXmlPatterns.QSourceLocation.__ne__(other)¶
- Parameters:
- Return type:
bool
Returns
trueif thisQSourceLocationis not equal toother;falseotherwise.
- PySide2.QtXmlPatterns.QSourceLocation.__eq__(other)¶
- Parameters:
- Return type:
bool
Returns
trueif thisQSourceLocationis equal toother;falseotherwise.Two
QSourceLocationinstances are equal if theiruri(),line()andcolumn()are equal.QSourceLocationinstances for whichisNull()returns true are considered equal.
- PySide2.QtXmlPatterns.QSourceLocation.setColumn(newColumn)¶
- Parameters:
newColumn – int
Sets the column number to
newColumn. 0 is an invalid column number. The first column number is 1.See also
- PySide2.QtXmlPatterns.QSourceLocation.setLine(newLine)¶
- Parameters:
newLine – int
Sets the line number to
newLine. 0 is an invalid line number. The first line number is 1.See also
- PySide2.QtXmlPatterns.QSourceLocation.setUri(newUri)¶
- Parameters:
newUri –
PySide2.QtCore.QUrl
Sets the URI to
newUri.See also
- PySide2.QtXmlPatterns.QSourceLocation.uri()¶
- Return type:
Returns the resource that this
QSourceLocationrefers to. For example, the resource could be a file in the local file system, if the URI scheme isfile.See also
© 2022 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.