Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QTextTable Class Reference

The QTextTable class represents a table in a QTextDocument. More...

#include <QTextTable>

Inherits QTextFrame.

List of all members.

Writable Properties

Public Functions

Public Slots

Signals

Static Public Members

Protected Functions


Detailed Description

The QTextTable class represents a table in a QTextDocument.

Tables can be created using QTextCursor::createTable() and queried with QTextCursor::currentTable().

A table's size can be changed with resize(), or by using insertRows(), insertColumns(), removeRows(), or removeColumns(). The overall format of the table can be changed with setFormat(). Use cellAt() to retrieve a QTextTableCell object that gives the properties of a given cell.

The cursor position of table rows in the document is available from rowStart() and rowEnd().


Member Function Documentation

QTextTableCell QTextTable::cellAt ( int row, int col ) const

Returns a QTextTableCell object that describes the properties of the specified table cell. The cell is identified by its row and col.

QTextTableCell QTextTable::cellAt ( int position ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

The cell is identified by its position.

QTextTableCell QTextTable::cellAt ( const QTextCursor & c ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

The cell is identified by its cursor position, c.

int QTextTable::columns () const

Returns the number of columns in the table.

See also rows().

QTextTableFormat QTextTable::format () const

Returns the table's format.

See also setFormat().

void QTextTable::insertColumns ( int pos, int num )

Inserts num colums before column pos.

See also insertRows(), resize(), removeRows(), and removeColumns().

void QTextTable::insertRows ( int pos, int num )

Inserts num rows before row pos.

See also resize(), insertColumns(), removeRows(), and removeColumns().

void QTextTable::removeColumns ( int pos, int num )

Removes num columns starting at column pos.

See also insertRows(), insertColumns(), removeRows(), and resize().

void QTextTable::removeRows ( int pos, int num )

Removes num rows starting at row pos.

See also insertRows(), insertColumns(), resize(), and removeColumns().

void QTextTable::resize ( int rows, int cols )

Resizes the table to rows rows and cols cols.

See also insertRows(), insertColumns(), removeRows(), and removeColumns().

QTextCursor QTextTable::rowEnd ( const QTextCursor & c ) const

Returns a QTextCursor pointing to the end of the row that contains cursor position c.

See also rowStart().

QTextCursor QTextTable::rowStart ( const QTextCursor & c ) const

Returns a QTextCursor pointing to the start of the row that contains cursor position c.

See also rowEnd().

int QTextTable::rows () const

Returns the number of rows in the table.

See also columns().

void QTextTable::setFormat ( const QTextTableFormat & format )

Sets the table's format to format.

See also format().


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp1