Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QTextBlockFormat

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.gui.QTextFormat
                      com.trolltech.qt.gui.QTextBlockFormat

All Implemented Interfaces:
  QtJambiInterface, java.lang.Cloneable

    public class QTextBlockFormat

extends QTextFormat
implements java.lang.Cloneable

The QTextBlockFormat class provides formatting information for blocks of text in a `QTextDocument`. A document is composed of a list of blocks, represented by `QTextBlock` objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics.

To cater for left-to-right and right-to-left languages you can set a block's direction with setDirection(). Paragraph alignment is set with `setAlignment()`. Margins are controlled by `setTopMargin()`, `setBottomMargin()`, `setLeftMargin()`, `setRightMargin()`. Overall indentation is set with `setIndent()`, the indentation of the first line with `setTextIndent()`.

Line breaking can be enabled and disabled with `setNonBreakableLines()`.

The brush used to paint the paragraph's background is set with `setBackground()`, and other aspects of the text's appearance can be customized by using the `setProperty()` function with the `OutlinePen`, `ForegroundBrush`, and `BackgroundBrush` `QTextFormat::Property` values.

If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function.

See also:
  `QTextBlock`, and `QTextCharFormat`.

Nested Class Summary

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, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal`

Field Summary

Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`currentSender`

Constructor Summary
`QTextBlockFormat()` Constructs a new QTextBlockFormat.

Method Summary
`Qt.Alignment` | `alignment()` Returns the paragraph's alignment.
`double` | `bottomMargin()` Returns the paragraph's bottom margin.
`QTextBlockFormat` | `clone()` This method is reimplemented for internal reasons
`int` | `indent()` Returns the paragraph's indent.
`double` | `leftMargin()` Returns the paragraph's left margin.
`boolean` | `nonBreakableLines()` Returns true if the lines in the paragraph are non-breakable; otherwise returns false.
`QTextFormat.PageBreakFlags` | `pageBreakPolicy()` Returns the currently set page break policy for the paragraph.
`double` | `rightMargin()` Returns the paragraph's right margin.
`void` | `setAlignment(Qt.Alignment alignment)` Sets the paragraph's `alignment`.
`void` | `setAlignment(Qt.AlignmentFlag[] alignment)`
`void` | `setBottomMargin(double margin)` Sets the paragraph's bottom `margin`.
`void` | `setIndent(int indent)` Sets the paragraph's `indentation`.
`void` | `setLeftMargin(double margin)` Sets the paragraph's left `margin`.
`void` | `setNonBreakableLines(boolean b)` If `b` is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.
`void` | `setPageBreakPolicy(QTextFormat.PageBreakFlag[] flags)`
`void` | `setPageBreakPolicy(QTextFormat.PageBreakFlags flags)` Sets the page break policy for the paragraph to `policy`.
`void` | `setRightMargin(double margin)` Sets the paragraph's right `margin`.
`void` | `setTabPositions(java.util.List tabs)` Sets the tab positions for the text block to those specified by `tabs`.
`void` | `setTextIndent(double margin)` Sets the `indent` for the first line in the block.
`void` | `setTopMargin(double margin)` Sets the paragraph's top `margin`.
`java.util.List` | `tabPositions()` Returns a list of tab positions defined for the text block.
`double` | `textIndent()` Returns the paragraph's text indent.
`double` | `topMargin()` Returns the paragraph's top margin.

Methods inherited from class com.trolltech.qt.gui.QTextFormat
`background, boolProperty, brushProperty, clearBackground, clearForeground, clearProperty, colorProperty, doubleProperty, foreground, hasProperty, intProperty, isBlockFormat, isCharFormat, isFrameFormat, isImageFormat, isListFormat, isTableCellFormat, isTableFormat, isValid, layoutDirection, lengthProperty, lengthVectorProperty, merge, objectIndex, objectType, penProperty, properties, property, propertyCount, readFrom, setBackground, setForeground, setLayoutDirection, setObjectIndex, setObjectType, setProperty, setProperty, stringProperty, toBlockFormat, toCharFormat, toFrameFormat, toImageFormat, toListFormat, toTableCellFormat, toTableFormat, type, writeTo`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread`

Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`__qt_signalInitialization`

Methods inherited from class java.lang.Object
`getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QTextBlockFormat

    public QTextBlockFormat()

  Constructs a new QTextBlockFormat.

Method Detail

### alignment

    public final Qt.Alignment alignment()

  Returns the paragraph's alignment.

See also:
  `setAlignment()`.

### bottomMargin

    public final double bottomMargin()

  Returns the paragraph's bottom margin.

See also:
  `setBottomMargin()`, and `topMargin()`.

### indent

    public final int indent()

  Returns the paragraph's indent.

See also:
  `setIndent()`.

### leftMargin

    public final double leftMargin()

  Returns the paragraph's left margin.

See also:
  `setLeftMargin()`, `rightMargin()`, and `indent()`.

### nonBreakableLines

    public final boolean nonBreakableLines()

  Returns true if the lines in the paragraph are non-breakable; otherwise returns false.

See also:
  `setNonBreakableLines()`.

### pageBreakPolicy

    public final QTextFormat.PageBreakFlags pageBreakPolicy()

  Returns the currently set page break policy for the paragraph. The default is `QTextFormat::PageBreak_Auto` .

See also:
  `setPageBreakPolicy()`.

### rightMargin

    public final double rightMargin()

  Returns the paragraph's right margin.

See also:
  `setRightMargin()`, and `leftMargin()`.

### setAlignment

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

### setAlignment

    public final void setAlignment(Qt.Alignment alignment)

  Sets the paragraph's `alignment`.

See also:
  `alignment()`.

### setBottomMargin

    public final void setBottomMargin(double margin)

  Sets the paragraph's bottom `margin`.

See also:
  `bottomMargin()`, `setTopMargin()`, `setLeftMargin()`, and `setRightMargin()`.

### setIndent

    public final void setIndent(int indent)

  Sets the paragraph's `indentation`. Margins are set independently of indentation with `setLeftMargin()` and `setTextIndent()`. The `indentation` is an integer that is multiplied with the document-wide standard indent, resulting in the actual indent of the paragraph.

See also:
  `indent()`, and `QTextDocument::indentWidth()`.

### setLeftMargin

    public final void setLeftMargin(double margin)

  Sets the paragraph's left `margin`. Indentation can be applied separately with `setIndent()`.

See also:
  `leftMargin()`, `setRightMargin()`, `setTopMargin()`, and `setBottomMargin()`.

### setNonBreakableLines

    public final void setNonBreakableLines(boolean b)

  If `b` is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.

See also:
  `nonBreakableLines()`.

### setPageBreakPolicy

    public final void setPageBreakPolicy(QTextFormat.PageBreakFlag[] flags)

### setPageBreakPolicy

    public final void setPageBreakPolicy(QTextFormat.PageBreakFlags flags)

  Sets the page break policy for the paragraph to `policy`.

See also:
  `pageBreakPolicy()`.

### setRightMargin

    public final void setRightMargin(double margin)

  Sets the paragraph's right `margin`.

See also:
  `rightMargin()`, `setLeftMargin()`, `setTopMargin()`, and `setBottomMargin()`.

### setTabPositions

    public final void setTabPositions(java.util.List tabs)

  Sets the tab positions for the text block to those specified by `tabs`.

See also:
  `tabPositions()`.

### setTextIndent

    public final void setTextIndent(double margin)

  Sets the `indent` for the first line in the block. This allows the first line of a paragraph to be indented differently to the other lines, enhancing the readability of the text.

See also:
  `textIndent()`, `setLeftMargin()`, `setRightMargin()`, `setTopMargin()`, and `setBottomMargin()`.

### setTopMargin

    public final void setTopMargin(double margin)

  Sets the paragraph's top `margin`.

See also:
  `topMargin()`, `setBottomMargin()`, `setLeftMargin()`, and `setRightMargin()`.

### tabPositions

    public final java.util.List tabPositions()

  Returns a list of tab positions defined for the text block.

See also:
  `setTabPositions()`.

### textIndent

    public final double textIndent()

  Returns the paragraph's text indent.

See also:
  `setTextIndent()`.

### topMargin

    public final double topMargin()

  Returns the paragraph's top margin.

See also:
  `setTopMargin()`, and `bottomMargin()`.

### clone

    public QTextBlockFormat clone()

  This method is reimplemented for internal reasons

  Overrides:
    `clone` in class `QTextFormat`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD