|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QTextFormat
com.trolltech.qt.gui.QTextBlockFormat
public class QTextBlockFormat
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.
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.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 | |
---|---|
QTextBlockFormat()
Constructs a new QTextBlockFormat. |
Method Summary | |
---|---|
Qt.Alignment |
alignment()
Returns the paragraph's alignment. |
double |
bottomMargin()
Returns the paragraph's bottom margin. |
static QTextBlockFormat |
fromNativePointer(QNativePointer nativePointer)
This function returns the QTextBlockFormat instance pointed to by nativePointer |
int |
indent()
Returns the paragraph's indent. |
boolean |
isValid()
Returns true if this block format is valid; otherwise returns false. |
double |
leftMargin()
Returns the paragraph's left margin. |
static QNativePointer |
nativePointerArray(QTextBlockFormat[] array)
This function returns a QNativePointer that is pointing to the specified QTextBlockFormat array. |
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)
Sets the paragraph's alignment. |
void |
setBottomMargin(double margin)
Sets the paragraph's bottom margin. |
void |
setIndent(int indent)
Sets the paragraph's indent. |
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)
Sets the page break policy for the paragraph to flags. |
void |
setPageBreakPolicy(QTextFormat.PageBreakFlags flags)
Sets the page break policy for the paragraph to flags. |
void |
setRightMargin(double margin)
Sets the paragraph's right margin. |
void |
setTextIndent(double margin)
Sets the margin for the first line in the block. |
void |
setTopMargin(double margin)
Sets the paragraph's top margin. |
double |
textIndent()
Returns the paragraph's text indent. |
double |
topMargin()
Returns the paragraph's top margin. |
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 |
---|
public QTextBlockFormat()
Constructs a new QTextBlockFormat.
Method Detail |
---|
public final Qt.Alignment alignment()
Returns the paragraph's alignment.
public final double bottomMargin()
Returns the paragraph's bottom margin.
public final int indent()
Returns the paragraph's indent.
public final boolean isValid()
Returns true if this block format is valid; otherwise returns false.
isValid
in class QTextFormat
public final double leftMargin()
Returns the paragraph's left margin.
public final boolean nonBreakableLines()
Returns true if the lines in the paragraph are non-breakable; otherwise returns false.
public final QTextFormat.PageBreakFlags pageBreakPolicy()
Returns the currently set page break policy for the paragraph. The default is QTextFormat::PageBreak_Auto.
public final double rightMargin()
Returns the paragraph's right margin.
public final void setAlignment(Qt.AlignmentFlag... alignment)
Sets the paragraph's alignment.
public final void setAlignment(Qt.Alignment alignment)
Sets the paragraph's alignment.
public final void setBottomMargin(double margin)
Sets the paragraph's bottom margin.
public final void setIndent(int indent)
Sets the paragraph's indent. Margins are set independently of indentation with setLeftMargin and setTextIdent().
public final void setLeftMargin(double margin)
Sets the paragraph's left margin. Indentation can be applied separately with setIndent.
public final void setNonBreakableLines(boolean b)
If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.
public final void setPageBreakPolicy(QTextFormat.PageBreakFlag... flags)
Sets the page break policy for the paragraph to flags.
public final void setPageBreakPolicy(QTextFormat.PageBreakFlags flags)
Sets the page break policy for the paragraph to flags.
public final void setRightMargin(double margin)
Sets the paragraph's right margin.
public final void setTextIndent(double margin)
Sets the margin 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.
public final void setTopMargin(double margin)
Sets the paragraph's top margin.
public final double textIndent()
Returns the paragraph's text indent.
public final double topMargin()
Returns the paragraph's top margin.
public static QTextBlockFormat fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QTextBlockFormat[] array)
array
- the array that the returned pointer will point to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |