|
|||||||||
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.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.
QTextFormat
, QTextBlockFormat
, QTextTableFormat
, and QTextListFormat
.
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.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 | |
---|---|
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 |
anchorNames()
Returns the anchor names associated with this text format, or an empty string list if none has been set. |
QTextCharFormat |
clone()
This method is reimplemented for internal reasons |
QFont |
font()
Returns the font for this character format. |
QFont.Capitalization |
fontCapitalization()
Returns the current capitalization type of the font. |
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. |
double |
fontLetterSpacing()
Returns the current letter spacing percentage. |
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. |
double |
fontWordSpacing()
Returns the current word spacing value. |
boolean |
isAnchor()
Returns true if the text is formatted as an anchor; otherwise returns false. |
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 names)
Sets the text format's anchor names. |
void |
setFont(QFont font)
Sets the text format's font. |
void |
setFontCapitalization(QFont.Capitalization capitalization)
Sets the capitalization of the text that apppears in this font to capitalization. |
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 |
setFontLetterSpacing(double spacing)
Sets the letter spacing of this format to the given spacing, in percent. |
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 |
setFontWordSpacing(double spacing)
Sets the word spacing of this format to the given spacing, in pixels. |
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 text. |
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. |
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, 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 QTextCharFormat()
Method Detail |
---|
public final java.lang.String anchorHref()
setAnchorHref()
.
public final java.util.List anchorNames()
setAnchorNames()
.
public final QFont font()
setFont()
.
public final QFont.Capitalization fontCapitalization()
setFontCapitalization()
.
public final java.lang.String fontFamily()
setFontFamily()
, and font()
.
public final boolean fontFixedPitch()
setFontFixedPitch()
, and font()
.
public final boolean fontItalic()
setFontItalic()
, and font()
.
public final double fontLetterSpacing()
setFontLetterSpacing()
.
public final boolean fontOverline()
setFontOverline()
, and font()
.
public final double fontPointSize()
setFontPointSize()
, and font()
.
public final boolean fontStrikeOut()
setFontStrikeOut()
, and font()
.
public final boolean fontUnderline()
setFontUnderline()
, and font()
.
public final int fontWeight()
setFontWeight()
, font()
, and QFont::Weight
.
public final double fontWordSpacing()
setFontWordSpacing()
.
public final boolean isAnchor()
setAnchor()
, setAnchorHref()
, and setAnchorNames()
.
public final void setAnchor(boolean anchor)
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.
isAnchor()
.
public final void setAnchorHref(java.lang.String value)
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()
.
anchorHref()
.
public final void setAnchorNames(java.util.List names)
setAnchorHref()
and the anchor must be enabled with setAnchor()
. anchorNames()
.
public final void setFont(QFont font)
font()
.
public final void setFontCapitalization(QFont.Capitalization capitalization)
A font's capitalization makes the text appear in the selected capitalization mode.
fontCapitalization()
.
public final void setFontFamily(java.lang.String family)
fontFamily()
, and setFont()
.
public final void setFontFixedPitch(boolean fixedPitch)
fontFixedPitch()
, and setFont()
.
public final void setFontItalic(boolean italic)
fontItalic()
, and setFont()
.
public final void setFontLetterSpacing(double spacing)
fontLetterSpacing()
.
public final void setFontOverline(boolean overline)
fontOverline()
, and setFont()
.
public final void setFontPointSize(double size)
fontPointSize()
, and setFont()
.
public final void setFontStrikeOut(boolean strikeOut)
fontStrikeOut()
, and setFont()
.
public final void setFontUnderline(boolean underline)
fontUnderline()
, and setFont()
.
public final void setFontWeight(int weight)
fontWeight()
, setFont()
, and QFont::Weight
.
public final void setFontWordSpacing(double spacing)
fontWordSpacing()
.
public final void setTextOutline(QPen pen)
textOutline()
.
public final void setToolTip(java.lang.String tip)
toolTip()
.
public final void setUnderlineColor(QColor color)
underlineColor()
.
public final void setUnderlineStyle(QTextCharFormat.UnderlineStyle style)
underlineStyle()
.
public final void setVerticalAlignment(QTextCharFormat.VerticalAlignment alignment)
verticalAlignment()
.
public final QPen textOutline()
setTextOutline()
.
public final java.lang.String toolTip()
setToolTip()
.
public final QColor underlineColor()
setUnderlineColor()
.
public final QTextCharFormat.UnderlineStyle underlineStyle()
setUnderlineStyle()
.
public final QTextCharFormat.VerticalAlignment verticalAlignment()
setVerticalAlignment()
.
public QTextCharFormat clone()
clone
in class QTextFormat
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |