|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.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 BackgroundBrushQTextFormat::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.
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.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)
This is an overloaded method provided for convenience. |
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)
This is an overloaded method provided for convenience. |
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 aindent)
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.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 |
---|
public QTextBlockFormat()
Method Detail |
---|
public final Qt.Alignment alignment()
setAlignment()
.
public final double bottomMargin()
setBottomMargin()
, and topMargin()
.
public final int indent()
setIndent()
.
public final double leftMargin()
setLeftMargin()
, rightMargin()
, and indent()
.
public final boolean nonBreakableLines()
setNonBreakableLines()
.
public final QTextFormat.PageBreakFlags pageBreakPolicy()
QTextFormat::PageBreak_Auto
. setPageBreakPolicy()
.
public final double rightMargin()
setRightMargin()
, and leftMargin()
.
public final void setAlignment(Qt.AlignmentFlag[] alignment)
public final void setAlignment(Qt.Alignment alignment)
alignment()
.
public final void setBottomMargin(double margin)
bottomMargin()
, setTopMargin()
, setLeftMargin()
, and setRightMargin()
.
public final void setIndent(int indent)
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. indent()
, and QTextDocument::indentWidth()
.
public final void setLeftMargin(double margin)
setIndent()
. leftMargin()
, setRightMargin()
, setTopMargin()
, and setBottomMargin()
.
public final void setNonBreakableLines(boolean b)
nonBreakableLines()
.
public final void setPageBreakPolicy(QTextFormat.PageBreakFlag[] flags)
public final void setPageBreakPolicy(QTextFormat.PageBreakFlags flags)
pageBreakPolicy()
.
public final void setRightMargin(double margin)
rightMargin()
, setLeftMargin()
, setTopMargin()
, and setBottomMargin()
.
public final void setTabPositions(java.util.List tabs)
tabPositions()
.
public final void setTextIndent(double aindent)
textIndent()
, setLeftMargin()
, setRightMargin()
, setTopMargin()
, and setBottomMargin()
.
public final void setTopMargin(double margin)
topMargin()
, setBottomMargin()
, setLeftMargin()
, and setRightMargin()
.
public final java.util.List tabPositions()
setTabPositions()
.
public final double textIndent()
setTextIndent()
.
public final double topMargin()
setTopMargin()
, and bottomMargin()
.
public QTextBlockFormat clone()
clone
in class QTextFormat
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |