• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QDesktopServices

    下一话题

    QTextDocumentFragment

    QTextTableCell

    详细描述

    PySide.QtGui.QTextTableCell class represents the properties of a cell in a PySide.QtGui.QTextTable .

    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 QTextCursor.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 PySide.QtGui.QTextTableCell.row() and PySide.QtGui.QTextTableCell.column() numbers of a cell, and its PySide.QtGui.QTextTableCell.rowSpan() and PySide.QtGui.QTextTableCell.columnSpan() .

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

    class PySide.QtGui. QTextTableCell
    class PySide.QtGui. QTextTableCell ( o )
    参数: o PySide.QtGui.QTextTableCell

    Constructs an invalid table cell.

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

    PySide.QtGui.QTextTableCell. begin ( )
    返回类型: PySide.QtGui.QTextFrame::iterator

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

    PySide.QtGui.QTextTableCell. column ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. columnSpan ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. end ( )
    返回类型: PySide.QtGui.QTextFrame::iterator

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

    PySide.QtGui.QTextTableCell. firstCursorPosition ( )
    返回类型: PySide.QtGui.QTextCursor

    Returns the first valid cursor position in this cell.

    PySide.QtGui.QTextTableCell. firstPosition ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. format ( )
    返回类型: PySide.QtGui.QTextCharFormat

    Returns the cell's character format.

    PySide.QtGui.QTextTableCell. isValid ( )
    返回类型: PySide.QtCore.bool

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

    PySide.QtGui.QTextTableCell. lastCursorPosition ( )
    返回类型: PySide.QtGui.QTextCursor

    Returns the last valid cursor position in this cell.

    PySide.QtGui.QTextTableCell. lastPosition ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. __ne__ ( other )
    参数: other PySide.QtGui.QTextTableCell
    返回类型: PySide.QtCore.bool

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

    PySide.QtGui.QTextTableCell. __eq__ ( other )
    参数: other PySide.QtGui.QTextTableCell
    返回类型: PySide.QtCore.bool

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

    PySide.QtGui.QTextTableCell. row ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. rowSpan ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextTableCell. setFormat ( format )
    参数: format PySide.QtGui.QTextCharFormat

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

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

    Note that the cell's row or column span cannot be changed through this function. You have to use QTextTable::mergeCells and QTextTable::splitCell instead.

    PySide.QtGui.QTextTableCell. tableCellFormatIndex ( )
    返回类型: PySide.QtCore.int

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