QSourceLocation Class Reference

[QtXmlPatterns module]

通过URI ,行和列在资源的QSourceLocation类标识的位置。More…

Methods

  • __init__ (self)
  • __init__ (self, QSourceLocation other)
  • __init__ (self, QUrl u, int line = -1, int column = -1)
  • int column (self)
  • bool isNull (self)
  • int line (self)
  • setColumn (self, int newColumn)
  • setLine (self, int newLine)
  • setUri (self, QUrl newUri)
  • QUrl uri (self)

Special Methods

  • bool __eq__ (self, QSourceLocation other)
  • int __hash__ (self)
  • bool __ne__ (self, QSourceLocation other)

Detailed Description

通过URI ,行和列在资源的QSourceLocation类标识的位置。

QSourceLocation是具有三个属性的简单基础的价值类,uri( )line()和column( ) ,那加在一起,确定某一个点在一个资源,例如文件或内存中的文件。

line()和column( )是指字符数(不是字节数) ,他们都从1开始,而不是0 。


Method Documentation

  1. QSourceLocation.__init__ (self)

构建QSourceLocation不识别任何东西。

对于默认构造QSourceLocation ( ) ,isNull()返回true

  1. QSourceLocation.__init__ (self, QSourceLocation other)

构造一个QSourceLocation即副本other

  1. QSourceLocation.__init__ (self, QUrl u, int line = -1, int column = -1)

构造一个QSourceLocation与URIu,行l和列c

  1. int QSourceLocation.column (self)

返回当前列号。列号指的是字符,而不是字节数。第一列是列1 ,而不是0 。默认值是-1 ,表明该列数是未知的。

See also setColumn( ) 。

  1. bool QSourceLocation.isNull (self)

Returns true如果这QSourceLocation不识别任何东西。

对于构造一个默认的QSourceLocation,这个函数返回true。这同样适用于任何其它QSourceLocationuri()是无效的。

  1. int QSourceLocation.line (self)

返回当前的行号。第一行号是1 ,而不是0 。默认值是-1,表示行数是未知的。

See also setLine( ) 。

  1. QSourceLocation.setColumn (self, int newColumn)

设置列数newColumn。 0是无效的列号。第一列号为1。

See also column( ) 。

  1. QSourceLocation.setLine (self, int newLine)

设置行号newLine。 0是无效的行号。第一行号为1。

See also line( ) 。

  1. QSourceLocation.setUri (self, QUrl newUri)

设置URI来newUri

See also uri( ) 。

  1. QUrl QSourceLocation.uri (self)

返回的资源,这QSourceLocation指。例如,资源可以在本地文件系统中的文件,如果URI方案是file

See also setUri( ) 。

  1. bool QSourceLocation.__eq__ (self, QSourceLocation other)
  1. int QSourceLocation.__hash__ (self)
  1. bool QSourceLocation.__ne__ (self, QSourceLocation other)