QTextTableCellclass represents the properties of a cell in aQTextTable. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
begin
()
def
column
()
def
columnSpan
()
def
end
()
def
firstCursorPosition
()
def
firstPosition
()
def
format
()
def
isValid
()
def
lastCursorPosition
()
def
lastPosition
()
def
row
()
def
rowSpan
()
def
setFormat
(format)
def
tableCellFormatIndex
()
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()andcolumn()numbers of a cell, and itsrowSpan()andcolumnSpan().
format()of a cell describes the default character format of its contents. ThefirstCursorPosition()andlastCursorPosition()functions are used to obtain the extent of the cell in the document.
QTextTableCell
¶
QTextTableCell(o)
- param o
Constructs an invalid table cell.
另请参阅
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.
另请参阅
PySide2.QtGui.QTextTableCell.
column
(
)
¶
int
Returns the number of the column in the table that contains this cell.
另请参阅
PySide2.QtGui.QTextTableCell.
columnSpan
(
)
¶
int
Returns the number of columns this cell spans. The default is 1.
另请参阅
PySide2.QtGui.QTextTableCell.
end
(
)
¶
iterator
Returns a frame iterator pointing to the end of the table’s cell.
另请参阅
PySide2.QtGui.QTextTableCell.
firstCursorPosition
(
)
¶
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
(
)
¶
Returns the cell’s character format.
另请参阅
PySide2.QtGui.QTextTableCell.
isValid
(
)
¶
bool
返回
true
if this is a valid table cell; otherwise returns false.
PySide2.QtGui.QTextTableCell.
lastCursorPosition
(
)
¶
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.
另请参阅
PySide2.QtGui.QTextTableCell.
rowSpan
(
)
¶
int
Returns the number of rows this cell spans. The default is 1.
另请参阅
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
代替。
另请参阅
PySide2.QtGui.QTextTableCell.
tableCellFormatIndex
(
)
¶
int
Returns the index of the tableCell’s format in the document’s internal list of formats.
另请参阅