内容表

上一话题

QTextTable

下一话题

QTextTableCellFormat

QTextTableCell

QTextTableCell class represents the properties of a cell in a QTextTable . 更多

Inheritance diagram of PySide2.QtGui.QTextTableCell

详细描述

Table cells are pieces of document structure that belong to a table. The table orders cells into particular rows and columns; cells can also span multiple columns and rows.

Cells are usually created when a table is inserted into a document with insertTable() , but they are also created and destroyed when a table is resized.

Cells contain information about their location in a table; you can obtain the row() and column() numbers of a cell, and its rowSpan() and columnSpan() .

format() of a cell describes the default character format of its contents. The firstCursorPosition() and lastCursorPosition() functions are used to obtain the extent of the cell in the document.

class QTextTableCell

QTextTableCell(o)

param o

QTextTableCell

Constructs an invalid table cell.

另请参阅

isValid()

Copy constructor. Creates a new QTextTableCell object based on the other cell.

PySide2.QtGui.QTextTableCell. begin ( )
返回类型

iterator

Returns a frame iterator pointing to the beginning of the table’s cell.

另请参阅

end()

PySide2.QtGui.QTextTableCell. column ( )
返回类型

int

Returns the number of the column in the table that contains this cell.

另请参阅

row()

PySide2.QtGui.QTextTableCell. columnSpan ( )
返回类型

int

Returns the number of columns this cell spans. The default is 1.

另请参阅

rowSpan()

PySide2.QtGui.QTextTableCell. end ( )
返回类型

iterator

Returns a frame iterator pointing to the end of the table’s cell.

另请参阅

begin()

PySide2.QtGui.QTextTableCell. firstCursorPosition ( )
返回类型

QTextCursor

Returns the first valid cursor position in this cell.

PySide2.QtGui.QTextTableCell. firstPosition ( )
返回类型

int

Returns the first valid position in the document occupied by this cell.

PySide2.QtGui.QTextTableCell. format ( )
返回类型

QTextCharFormat

Returns the cell’s character format.

另请参阅

setFormat()

PySide2.QtGui.QTextTableCell. isValid ( )
返回类型

bool

返回 true if this is a valid table cell; otherwise returns false.

PySide2.QtGui.QTextTableCell. lastCursorPosition ( )
返回类型

QTextCursor

Returns the last valid cursor position in this cell.

PySide2.QtGui.QTextTableCell. lastPosition ( )
返回类型

int

Returns the last valid position in the document occupied by this cell.

PySide2.QtGui.QTextTableCell. __ne__ ( other )
参数

other QTextTableCell

返回类型

bool

返回 true if this cell object and the other cell object describe different cells; otherwise returns false .

PySide2.QtGui.QTextTableCell. __eq__ ( other )
参数

other QTextTableCell

返回类型

bool

返回 true if this cell object and the other cell object describe the same cell; otherwise returns false .

PySide2.QtGui.QTextTableCell. row ( )
返回类型

int

Returns the number of the row in the table that contains this cell.

另请参阅

column()

PySide2.QtGui.QTextTableCell. rowSpan ( )
返回类型

int

Returns the number of rows this cell spans. The default is 1.

另请参阅

columnSpan()

PySide2.QtGui.QTextTableCell. setFormat ( format )
参数

format QTextCharFormat

Sets the cell’s character format to format . This can for example be used to change the background color of the entire cell:

QTextTableCell cell = table->cellAt(2, 3); QTextCharFormat format = cell. format() ; format.setBackground( blue ); cell.(format);

Note that the cell’s row or column span cannot be changed through this function. You have to use mergeCells and splitCell 代替。

另请参阅

format()

PySide2.QtGui.QTextTableCell. tableCellFormatIndex ( )
返回类型

int

Returns the index of the tableCell’s format in the document’s internal list of formats.

另请参阅

allFormats()