Sophie

Sophie

distrib > * > 2009.0 > i586 > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2334

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QTextTable" doc="/**
&lt;p&gt;The &lt;a href=&quot;QTextTable.html#QTextTable(com.trolltech.qt.gui.QTextDocument)&quot;&gt;&lt;tt&gt;QTextTable&lt;/tt&gt;&lt;/a&gt; class represents a table in a &lt;a href=&quot;QTextDocument.html&quot;&gt;&lt;tt&gt;QTextDocument&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block, and is surrounded by a frame.&lt;/p&gt;
&lt;p&gt;Tables are usually created and inserted into a document with the QTextCursor::insertTable() function. For example, we can insert a table with three rows and two columns at the current cursor position in an editor using the following lines of code:&lt;/p&gt;
&lt;pre&gt;        QTextCursor cursor(editor-&amp;gt;textCursor());
        cursor.movePosition(QTextCursor::Start);

        QTextTable *table = cursor.insertTable(rows, columns, tableFormat);&lt;/pre&gt;
&lt;p&gt;The table format is either defined when the table is created or changed later with &lt;a href=&quot;QTextTable.html#setFormat(com.trolltech.qt.gui.QTextTableFormat)&quot;&gt;&lt;tt&gt;setFormat&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The table currently being edited by the cursor is found with QTextCursor::currentTable(). This allows its format or dimensions to be changed after it has been inserted into a document.&lt;/p&gt;
&lt;p&gt;A table's size can be changed with &lt;a href=&quot;QTextTable.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt;, or by using &lt;a href=&quot;QTextTable.html#insertRows(int, int)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTextTable.html#insertColumns(int, int)&quot;&gt;&lt;tt&gt;insertColumns&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTextTable.html#removeRows(int, int)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;, or &lt;a href=&quot;QTextTable.html#removeColumns(int, int)&quot;&gt;&lt;tt&gt;removeColumns&lt;/tt&gt;&lt;/a&gt;. Use &lt;a href=&quot;QTextTable.html#cellAt(int)&quot;&gt;&lt;tt&gt;cellAt&lt;/tt&gt;&lt;/a&gt; to retrieve table cells.&lt;/p&gt;
&lt;p&gt;The starting and ending positions of table rows can be found by moving a cursor within a table, and using the &lt;a href=&quot;QTextTable.html#rowStart(com.trolltech.qt.gui.QTextCursor)&quot;&gt;&lt;tt&gt;rowStart&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QTextTable.html#rowEnd(com.trolltech.qt.gui.QTextCursor)&quot;&gt;&lt;tt&gt;rowEnd&lt;/tt&gt;&lt;/a&gt; functions to obtain cursors at the start and end of each row.&lt;/p&gt;
&lt;p&gt;Rows and columns within a &lt;a href=&quot;QTextTable.html#QTextTable(com.trolltech.qt.gui.QTextDocument)&quot;&gt;&lt;tt&gt;QTextTable&lt;/tt&gt;&lt;/a&gt; can be merged and split using the &lt;a href=&quot;QTextTable.html#mergeCells(int, int, int, int)&quot;&gt;&lt;tt&gt;mergeCells&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QTextTable.html#splitCell(int, int, int, int)&quot;&gt;&lt;tt&gt;splitCell&lt;/tt&gt;&lt;/a&gt; functions. However, only cells that span multiple rows or columns can be split. (Merging or splitting does not increase or decrease the number of rows and columns.)&lt;/p&gt;
&lt;p&gt;&lt;table width=&quot;80%&quot; align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;img src=&quot;%2E%2E/images/texttable-split.png&quot; alt=&quot;Original Table&quot; /&gt;&lt;/td&gt;&lt;td&gt;Suppose we have a 2x6 table of names and addresses. To merge both columns in the first row we invoke &lt;a href=&quot;QTextTable.html#mergeCells(int, int, int, int)&quot;&gt;&lt;tt&gt;mergeCells&lt;/tt&gt;&lt;/a&gt; with &lt;tt&gt;row&lt;/tt&gt; = 0, &lt;tt&gt;column&lt;/tt&gt; = 0, &lt;tt&gt;numRows&lt;/tt&gt; = 1 and &lt;tt&gt;numColumns&lt;/tt&gt; = 2.&lt;pre&gt;        table-&amp;gt;mergeCells(0, 0, 1, 2);&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;img src=&quot;%2E%2E/images/texttable-merge.png&quot; /&gt;&lt;/td&gt;&lt;td&gt;This gives us the following table. To split the first row of the table back into two cells, we invoke the &lt;a href=&quot;QTextTable.html#splitCell(int, int, int, int)&quot;&gt;&lt;tt&gt;splitCell&lt;/tt&gt;&lt;/a&gt; function with &lt;tt&gt;numRows&lt;/tt&gt; and &lt;tt&gt;numCols&lt;/tt&gt; = 1.&lt;pre&gt;        table-&amp;gt;splitCell(0, 0, 1, 1);&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;img src=&quot;%2E%2E/images/texttable-split.png&quot; alt=&quot;Split Table&quot; /&gt;&lt;/td&gt;&lt;td&gt;This results in the original table.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;

@see &lt;a href=&quot;QTextTableFormat.html&quot;&gt;&lt;tt&gt;QTextTableFormat&lt;/tt&gt;&lt;/a&gt; */">
    <method name="public QTextTable(com.trolltech.qt.gui.QTextDocument doc)" doc="/**
&lt;p&gt;This method is used internally by Qt Jambi.
Do not use it in your applications.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QTextTableCell cellAt(com.trolltech.qt.gui.QTextCursor c)" doc="/**
&lt;p&gt;Returns the table cell containing the given &lt;tt&gt;c&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QTextTableCell cellAt(int row, int col)" doc="/**
&lt;p&gt;Returns the table cell at the given &lt;tt&gt;row&lt;/tt&gt; and &lt;tt&gt;col&lt;/tt&gt; in the table.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#columns()&quot;&gt;&lt;tt&gt;columns&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#rows()&quot;&gt;&lt;tt&gt;rows&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QTextTableCell cellAt(int position)" doc="/**
&lt;p&gt;Returns the table cell that contains the character at the given &lt;tt&gt;position&lt;/tt&gt; in the document.&lt;/p&gt;
 */"/>
    <method name="public final int columns()" doc="/**
&lt;p&gt;Returns the number of columns in the table.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#rows()&quot;&gt;&lt;tt&gt;rows&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QTextTableFormat tableFormat()" doc="/**
&lt;p&gt;Returns the table's format.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#setFormat(com.trolltech.qt.gui.QTextTableFormat)&quot;&gt;&lt;tt&gt;setFormat&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void insertColumns(int pos, int num)" doc="/**
&lt;p&gt;Inserts a number of &lt;tt&gt;num&lt;/tt&gt; before the column with the specified &lt;tt&gt;pos&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#insertRows(int, int)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeRows(int, int)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeColumns(int, int)&quot;&gt;&lt;tt&gt;removeColumns&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void insertRows(int pos, int num)" doc="/**
&lt;p&gt;Inserts a number of &lt;tt&gt;num&lt;/tt&gt; before the row with the specified &lt;tt&gt;pos&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#insertColumns(int, int)&quot;&gt;&lt;tt&gt;insertColumns&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeRows(int, int)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeColumns(int, int)&quot;&gt;&lt;tt&gt;removeColumns&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void mergeCells(com.trolltech.qt.gui.QTextCursor cursor)" doc="/**
&lt;p&gt;Merges the cells selected by the provided &lt;tt&gt;cursor&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#splitCell(int, int, int, int)&quot;&gt;&lt;tt&gt;splitCell&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void mergeCells(int row, int col, int numRows, int numCols)" doc="/**
&lt;p&gt;Merges the cell at the specified &lt;tt&gt;row&lt;/tt&gt; and &lt;tt&gt;col&lt;/tt&gt; with the adjacent cells into one cell. The new cell will span &lt;tt&gt;numRows&lt;/tt&gt; rows and &lt;tt&gt;numCols&lt;/tt&gt; columns. If &lt;tt&gt;numRows&lt;/tt&gt; or &lt;tt&gt;numCols&lt;/tt&gt; is less than the current number of rows or columns the cell spans then this method does nothing.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#splitCell(int, int, int, int)&quot;&gt;&lt;tt&gt;splitCell&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void removeColumns(int pos, int num)" doc="/**
&lt;p&gt;Removes a number of &lt;tt&gt;num&lt;/tt&gt; starting with the column at the specified &lt;tt&gt;pos&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#insertRows(int, int)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#insertColumns(int, int)&quot;&gt;&lt;tt&gt;insertColumns&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeRows(int, int)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void removeRows(int pos, int num)" doc="/**
&lt;p&gt;Removes a number of &lt;tt&gt;num&lt;/tt&gt; starting with the row at the specified &lt;tt&gt;pos&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#insertRows(int, int)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#insertColumns(int, int)&quot;&gt;&lt;tt&gt;insertColumns&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeColumns(int, int)&quot;&gt;&lt;tt&gt;removeColumns&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void resize(int rows, int cols)" doc="/**
&lt;p&gt;Resizes the table to contain the required number of &lt;tt&gt;rows&lt;/tt&gt; and &lt;tt&gt;cols&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#insertRows(int, int)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#insertColumns(int, int)&quot;&gt;&lt;tt&gt;insertColumns&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeRows(int, int)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextTable.html#removeColumns(int, int)&quot;&gt;&lt;tt&gt;removeColumns&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QTextCursor rowEnd(com.trolltech.qt.gui.QTextCursor c)" doc="/**
&lt;p&gt;Returns a cursor pointing to the end of the row that contains the given &lt;tt&gt;c&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#rowStart(com.trolltech.qt.gui.QTextCursor)&quot;&gt;&lt;tt&gt;rowStart&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QTextCursor rowStart(com.trolltech.qt.gui.QTextCursor c)" doc="/**
&lt;p&gt;Returns a cursor pointing to the start of the row that contains the given &lt;tt&gt;c&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#rowEnd(com.trolltech.qt.gui.QTextCursor)&quot;&gt;&lt;tt&gt;rowEnd&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int rows()" doc="/**
&lt;p&gt;Returns the number of rows in the table.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#columns()&quot;&gt;&lt;tt&gt;columns&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setFormat(com.trolltech.qt.gui.QTextTableFormat format)" doc="/**
&lt;p&gt;Sets the table's &lt;tt&gt;format&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextObject.html#format()&quot;&gt;&lt;tt&gt;format&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void splitCell(int row, int col, int numRows, int numCols)" doc="/**
&lt;p&gt;Splits the specified cell at &lt;tt&gt;row&lt;/tt&gt; and &lt;tt&gt;col&lt;/tt&gt; into an array of multiple cells with dimensions specified by &lt;tt&gt;numRows&lt;/tt&gt; and &lt;tt&gt;numCols&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; It is only possible to split cells that span multiple rows or columns, such as rows that have been merged using &lt;a href=&quot;QTextTable.html#mergeCells(int, int, int, int)&quot;&gt;&lt;tt&gt;mergeCells&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTextTable.html#mergeCells(int, int, int, int)&quot;&gt;&lt;tt&gt;mergeCells&lt;/tt&gt;&lt;/a&gt; */"/>
</class>