Qt Jambi Home

com.trolltech.qt.gui
Class QTextTableFormat

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.gui.QTextFormat
              extended by com.trolltech.qt.gui.QTextFrameFormat
                  extended by com.trolltech.qt.gui.QTextTableFormat
All Implemented Interfaces:
QtJambiInterface

public class QTextTableFormat
extends QTextFrameFormat

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

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. Tables in rich text documents are formatted using the properties defined in this class.

Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the alignment function and set with setAlignment.

Cells within the table are separated by cell spacing. The number of pixels between cells is set with setCellSpacing and read with cellSpacing. The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with setCellPadding and read with cellPadding.

The table's background color can be read with the background function, and can be specified with setBackground. The background color of each cell can be set independently, and will control the color of the cell within the padded area.

The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see QTextLength). The columns function returns the number of columns with constraints, and the columnWidthConstraints function returns the constraints defined for the table. These quantities can also be set by calling setColumnWidthConstraints with a vector containing new constraints. If no constraints are required, clearColumnWidthConstraints can be used to remove them.

See Also:
QTextTable, QTextTableCell, QTextLength

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QTextFrameFormat
QTextFrameFormat.BorderStyle, QTextFrameFormat.Position
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QTextFormat
QTextFormat.FormatType, QTextFormat.ObjectTypes, QTextFormat.PageBreakFlag, QTextFormat.PageBreakFlags, QTextFormat.Property
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QTextTableFormat()
          Constructs a new table format object.
 
Method Summary
 Qt.Alignment alignment()
          Returns the table's alignment.
 double cellPadding()
          Returns the table's cell padding.
 double cellSpacing()
          Returns the table's cell spacing.
 void clearColumnWidthConstraints()
          Clears the column width constraints for the table.
 int columns()
          Returns the number of columns specified by the table format.
 java.util.List<QTextLength> columnWidthConstraints()
          Returns a list of constraints used by this table format to control the appearance of columns in a table.
static QTextTableFormat fromNativePointer(QNativePointer nativePointer)
          This function returns the QTextTableFormat instance pointed to by nativePointer
 int headerRowCount()
          Returns the number of rows in the table that define the header.
 boolean isValid()
          Returns true if this table format is valid; otherwise returns false.
static QNativePointer nativePointerArray(QTextTableFormat[] array)
          This function returns a QNativePointer that is pointing to the specified QTextTableFormat array.
 void setAlignment(Qt.Alignment alignment)
          Sets the table's alignment.
 void setAlignment(Qt.AlignmentFlag... alignment)
          Sets the table's alignment.
 void setCellPadding(double padding)
          Sets the cell padding for the table.
 void setCellSpacing(double spacing)
          Sets the cell spacing for the table.
 void setColumns(int columns)
          
 void setColumnWidthConstraints(java.util.List<QTextLength> constraints)
          Sets the column width constraints for the table.
 void setHeaderRowCount(int count)
          Declares the first count rows of the table as table header.
 
Methods inherited from class com.trolltech.qt.gui.QTextFrameFormat
border, borderBrush, borderStyle, bottomMargin, height, leftMargin, margin, nativePointerArray, padding, pageBreakPolicy, position, rightMargin, setBorder, setBorderBrush, setBorderStyle, setBottomMargin, setHeight, setHeight, setLeftMargin, setMargin, setPadding, setPageBreakPolicy, setPageBreakPolicy, setPosition, setRightMargin, setTopMargin, setWidth, setWidth, topMargin, width
 
Methods inherited from class com.trolltech.qt.gui.QTextFormat
background, boolProperty, brushProperty, clearBackground, clearForeground, clearProperty, colorProperty, doubleProperty, equals, foreground, hasProperty, intProperty, isBlockFormat, isCharFormat, isFrameFormat, isImageFormat, isListFormat, isTableFormat, layoutDirection, lengthProperty, lengthVectorProperty, merge, nativePointerArray, objectIndex, objectType, penProperty, properties, property, propertyCount, readFrom, setBackground, setForeground, setLayoutDirection, setObjectIndex, setObjectType, setProperty, setProperty, stringProperty, toBlockFormat, toCharFormat, toFrameFormat, toImageFormat, toListFormat, toTableFormat, type, writeTo
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QTextTableFormat

public QTextTableFormat()

Constructs a new table format object.

Method Detail

alignment

public final Qt.Alignment alignment()

Returns the table's alignment.

See Also:
setAlignment

cellPadding

public final double cellPadding()

Returns the table's cell padding. This describes the distance between the border of a cell and its contents.

See Also:
setCellPadding

cellSpacing

public final double cellSpacing()

Returns the table's cell spacing. This describes the distance between adjacent cells.

See Also:
setCellSpacing

clearColumnWidthConstraints

public final void clearColumnWidthConstraints()

Clears the column width constraints for the table.

See Also:
columnWidthConstraints, setColumnWidthConstraints

columnWidthConstraints

public final java.util.List<QTextLength> columnWidthConstraints()

Returns a list of constraints used by this table format to control the appearance of columns in a table.

See Also:
setColumnWidthConstraints

columns

public final int columns()

Returns the number of columns specified by the table format.

See Also:
setColumns

headerRowCount

public final int headerRowCount()

Returns the number of rows in the table that define the header.

See Also:
setHeaderRowCount

isValid

public final boolean isValid()

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

Overrides:
isValid in class QTextFrameFormat

setAlignment

public final void setAlignment(Qt.AlignmentFlag... alignment)

Sets the table's alignment.

See Also:
alignment

setAlignment

public final void setAlignment(Qt.Alignment alignment)

Sets the table's alignment.

See Also:
alignment

setCellPadding

public final void setCellPadding(double padding)

Sets the cell padding for the table. This determines the distance between the border of a cell and its contents.

See Also:
cellPadding

setCellSpacing

public final void setCellSpacing(double spacing)

Sets the cell spacing for the table. This determines the distance between adjacent cells.

See Also:
cellSpacing

setColumnWidthConstraints

public final void setColumnWidthConstraints(java.util.List<QTextLength> constraints)

Sets the column width constraints for the table.

See Also:
columnWidthConstraints, clearColumnWidthConstraints

setColumns

public final void setColumns(int columns)

See Also:
columns

setHeaderRowCount

public final void setHeaderRowCount(int count)

Declares the first count rows of the table as table header. The table header rows get repeated when a table is broken across a page boundary.

See Also:
headerRowCount

fromNativePointer

public static QTextTableFormat fromNativePointer(QNativePointer nativePointer)
This function returns the QTextTableFormat instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QTextTableFormat[] array)
This function returns a QNativePointer that is pointing to the specified QTextTableFormat array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

Qt Jambi Home