|
|||||||||
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.QTextCharFormat
public class QTextCharFormat
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.
The font used can be set by supplying a font to the setFont function, and each aspect of its appearance can be adjusted to give the desired effect. setFontFamily and setFontPointSize define the font's family (e.g. Times) and printed size; setFontWeight and setFontItalic provide control over the style of the font. setFontUnderline, setFontOverline, setFontStrikeOut, and setFontFixedPitch provide additional effects for text.
The color is set with setForeground. If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with setAnchor. The setAnchorHref and setAnchorNames functions are used to specify the information about the hyperlink's destination and the anchor's name.
Nested Class Summary | |
---|---|
static class |
QTextCharFormat.UnderlineStyle
This enum describes the different ways drawing underlined text. |
static class |
QTextCharFormat.VerticalAlignment
This enum describes the ways that adjacent characters can be vertically aligned. |
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 | |
---|---|
QTextCharFormat()
Constructs a new character format object. |
Method Summary | |
---|---|
java.lang.String |
anchorHref()
Returns the text format's hypertext link, or an empty string if none has been set. |
java.util.List<java.lang.String> |
anchorNames()
Returns the anchor names associated with this text format, or an empty string list if none has been set. |
QFont |
font()
Returns the font for this character format. |
java.lang.String |
fontFamily()
Returns the text format's font family. |
boolean |
fontFixedPitch()
Returns true if the text format's font is fixed pitch; otherwise returns false. |
boolean |
fontItalic()
Returns true if the text format's font is italic; otherwise returns false. |
boolean |
fontOverline()
Returns true if the text format's font is overlined; otherwise returns false. |
double |
fontPointSize()
Returns the font size used to display text in this format. |
boolean |
fontStrikeOut()
Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false. |
boolean |
fontUnderline()
Returns true if the text format's font is underlined; otherwise returns false. |
int |
fontWeight()
Returns the text format's font weight. |
static QTextCharFormat |
fromNativePointer(QNativePointer nativePointer)
This function returns the QTextCharFormat instance pointed to by nativePointer |
boolean |
isAnchor()
Returns true if the text is formatted as an anchor; otherwise returns false. |
boolean |
isValid()
Returns true if this character format is valid; otherwise returns false. |
static QNativePointer |
nativePointerArray(QTextCharFormat[] array)
This function returns a QNativePointer that is pointing to the specified QTextCharFormat array. |
void |
setAnchor(boolean anchor)
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. |
void |
setAnchorHref(java.lang.String value)
Sets the hypertext link for the text format to the given value. |
void |
setAnchorNames(java.util.List<java.lang.String> names)
Sets the text format's anchor names. |
void |
setFont(QFont font)
Sets the text format's font. |
void |
setFontFamily(java.lang.String family)
Sets the text format's font family. |
void |
setFontFixedPitch(boolean fixedPitch)
If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used. |
void |
setFontItalic(boolean italic)
If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic. |
void |
setFontOverline(boolean overline)
If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined. |
void |
setFontPointSize(double size)
Sets the text format's font size. |
void |
setFontStrikeOut(boolean strikeOut)
If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout. |
void |
setFontUnderline(boolean underline)
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined. |
void |
setFontWeight(int weight)
Sets the text format's font weight to weight. |
void |
setTableCellColumnSpan(int tableCellColumnSpan)
This method is used internally by Qt Jambi. |
void |
setTableCellRowSpan(int tableCellRowSpan)
This method is used internally by Qt Jambi. |
void |
setTextOutline(QPen pen)
Sets the pen used to draw the outlines of characters to the given pen. |
void |
setToolTip(java.lang.String tip)
Sets the tool tip for a fragment of text to the given tip. |
void |
setUnderlineColor(QColor color)
Sets the underline color used for the characters with this format to the color specified. |
void |
setUnderlineStyle(QTextCharFormat.UnderlineStyle style)
Sets the style of underlining the text to style. |
void |
setVerticalAlignment(QTextCharFormat.VerticalAlignment alignment)
Sets the vertical alignment used for the characters with this format to the alignment specified. |
int |
tableCellColumnSpan()
This method is used internally by Qt Jambi. |
int |
tableCellRowSpan()
This method is used internally by Qt Jambi. |
QPen |
textOutline()
Returns the pen used to draw the outlines of characters in this format. |
java.lang.String |
toolTip()
Returns the tool tip that is displayed for a fragment of text. |
QColor |
underlineColor()
Returns the color used to underline the characters with this format. |
QTextCharFormat.UnderlineStyle |
underlineStyle()
Returns the style of underlining the text. |
QTextCharFormat.VerticalAlignment |
verticalAlignment()
Returns the vertical alignment used for characters with this format. |
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 QTextCharFormat()
Constructs a new character format object.
Method Detail |
---|
public final java.lang.String anchorHref()
Returns the text format's hypertext link, or an empty string if none has been set.
public final java.util.List<java.lang.String> anchorNames()
Returns the anchor names associated with this text format, or an empty string list if none has been set. If the anchor names are set, text with this format can be the destination of a hypertext link.
public final QFont font()
Returns the font for this character format.
public final java.lang.String fontFamily()
Returns the text format's font family.
public final boolean fontFixedPitch()
Returns true if the text format's font is fixed pitch; otherwise returns false.
public final boolean fontItalic()
Returns true if the text format's font is italic; otherwise returns false.
public final boolean fontOverline()
Returns true if the text format's font is overlined; otherwise returns false.
public final double fontPointSize()
Returns the font size used to display text in this format.
public final boolean fontStrikeOut()
Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false.
public final boolean fontUnderline()
Returns true if the text format's font is underlined; otherwise returns false.
public final int fontWeight()
Returns the text format's font weight.
public final boolean isAnchor()
Returns true if the text is formatted as an anchor; otherwise returns false.
public boolean isValid()
Returns true if this character format is valid; otherwise returns false.
isValid
in class QTextFormat
public final void setAnchor(boolean anchor)
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. (Anchors are hyperlinks which are often shown underlined and in a different color from plain text.)
The way the text is rendered is independent of whether or not the format has a valid anchor defined. Use setAnchorHref, and optionally setAnchorNames to create a hypertext link.
public final void setAnchorHref(java.lang.String value)
Sets the hypertext link for the text format to the given value. This is typically a URL like "http://www.trolltech.com/index.html".
The anchor will be displayed with the value as its display text; if you want to display different text call setAnchorNames.
To format the text as a hypertext link use setAnchor.
public final void setAnchorNames(java.util.List<java.lang.String> names)
Sets the text format's anchor names. For the anchor to work as a hyperlink, the destination must be set with setAnchorHref and the anchor must be enabled with setAnchor.
public final void setFont(QFont font)
Sets the text format's font.
public final void setFontFamily(java.lang.String family)
Sets the text format's font family.
public final void setFontFixedPitch(boolean fixedPitch)
If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used.
public final void setFontItalic(boolean italic)
If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic.
public final void setFontOverline(boolean overline)
If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined.
public final void setFontPointSize(double size)
Sets the text format's font size.
public final void setFontStrikeOut(boolean strikeOut)
If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout.
public final void setFontUnderline(boolean underline)
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined.
public final void setFontWeight(int weight)
Sets the text format's font weight to weight.
public final void setTableCellColumnSpan(int tableCellColumnSpan)
This method is used internally by Qt Jambi. Do not use it in your applications.
public final void setTableCellRowSpan(int tableCellRowSpan)
This method is used internally by Qt Jambi. Do not use it in your applications.
public final void setTextOutline(QPen pen)
Sets the pen used to draw the outlines of characters to the given pen.
public final void setToolTip(java.lang.String tip)
Sets the tool tip for a fragment of text to the given tip.
public final void setUnderlineColor(QColor color)
Sets the underline color used for the characters with this format to the color specified.
public final void setUnderlineStyle(QTextCharFormat.UnderlineStyle style)
Sets the style of underlining the text to style.
public final void setVerticalAlignment(QTextCharFormat.VerticalAlignment alignment)
Sets the vertical alignment used for the characters with this format to the alignment specified.
public final int tableCellColumnSpan()
This method is used internally by Qt Jambi. Do not use it in your applications.
public final int tableCellRowSpan()
This method is used internally by Qt Jambi. Do not use it in your applications.
public final QPen textOutline()
Returns the pen used to draw the outlines of characters in this format.
public final java.lang.String toolTip()
Returns the tool tip that is displayed for a fragment of text.
public final QColor underlineColor()
Returns the color used to underline the characters with this format.
public final QTextCharFormat.UnderlineStyle underlineStyle()
Returns the style of underlining the text.
public final QTextCharFormat.VerticalAlignment verticalAlignment()
Returns the vertical alignment used for characters with this format.
public static QTextCharFormat fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QTextCharFormat[] 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 |