|
|||||||||
| 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.QTextLine
public class QTextLine
The QTextLine class represents a line of text inside a QTextLayout. A text line is usually created by QTextLayout::createLine().
After being created, the line can be filled using the setLineWidth() or setNumColumns() functions. A line has a number of attributes including the rectangle it occupies, rect(), its coordinates, x() and y(), its textLength(), width() and naturalTextWidth(), and its ascent() and decent() relative to the text. The position of the cursor in terms of the line is available from cursorToX() and its inverse from xToCursor(). A line can be moved with setPosition().
| Nested Class Summary | |
|---|---|
static class |
QTextLine.CursorPosition
|
static class |
QTextLine.Edge
|
| 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 | |
|---|---|
QTextLine()
Creates an invalid line. |
|
| Method Summary | |
|---|---|
double |
ascent()
Returns the line's ascent. |
QTextLine |
clone()
This method is reimplemented for internal reasons |
double |
cursorToX(int cursorPos)
Converts the cursor position cursorPos to the corresponding x position inside the line, taking account of the edge. |
double |
cursorToX(int cursorPos,
QTextLine.Edge edge)
Converts the cursor position cursorPos to the corresponding x position inside the line, taking account of the edge. |
double |
descent()
Returns the line's descent. |
void |
draw(QPainter painter,
QPointF position)
This is an overloaded method provided for convenience. |
double |
height()
Returns the line's height. |
boolean |
isValid()
Returns true if this text line is valid; otherwise returns false. |
int |
lineNumber()
Returns the position of the line in the text engine. |
QRectF |
naturalTextRect()
Returns the rectangle covered by the line. |
double |
naturalTextWidth()
Returns the width of the line that is occupied by text. |
QPointF |
position()
Returns the line's position relative to the text layout's position. |
QRectF |
rect()
Returns the line's bounding rectangle. |
void |
setLineWidth(double width)
Lays out the line with the given width. |
void |
setNumColumns(int columns)
Lays out the line. |
void |
setNumColumns(int columns,
double alignmentWidth)
Lays out the line. |
void |
setPosition(QPointF pos)
Moves the line to position pos. |
int |
textLength()
Returns the length of the text in the line. |
int |
textStart()
Returns the start of the line from the beginning of the string passed to the QTextLayout. |
double |
width()
Returns the line's width as specified by the layout() function. |
double |
x()
Returns the line's x position. |
int |
xToCursor(double x)
Converts the x-coordinate x, to the nearest matching cursor position, depending on the cursor position type, cpos. |
int |
xToCursor(double x,
QTextLine.CursorPosition arg__2)
Converts the x-coordinate x, to the nearest matching cursor position, depending on the cursor position type, cpos. |
double |
y()
Returns the line's y position. |
| 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 QTextLine()
| Method Detail |
|---|
public final double ascent()
descent(), and height().
public final double cursorToX(int cursorPos)
If cursorPos is not a valid cursor position, the nearest valid cursor position will be used instead, and cpos will be modified to point to this valid cursor position.
xToCursor().
public final double cursorToX(int cursorPos,
QTextLine.Edge edge)
If cursorPos is not a valid cursor position, the nearest valid cursor position will be used instead, and cpos will be modified to point to this valid cursor position.
xToCursor().
public final double descent()
ascent(), and height().
public final double height()
ascent() + descent() + 1. ascent(), and descent().
public final boolean isValid()
public final int lineNumber()
public final QRectF naturalTextRect()
public final double naturalTextWidth()
width(), and is the minimum width that could be used by layout() without changing the line break position.
public final QPointF position()
setPosition().
public final QRectF rect()
x(), y(), textLength(), and width().
public final void setLineWidth(double width)
public final void setNumColumns(int columns)
public final void setNumColumns(int columns,
double alignmentWidth)
public final void setPosition(QPointF pos)
position().
public final int textLength()
naturalTextWidth().
public final int textStart()
QTextLayout.
public final double width()
naturalTextWidth(), x(), y(), textLength(), and rect().
public final double x()
rect(), y(), textLength(), and width().
public final int xToCursor(double x)
cursorToX().
public final int xToCursor(double x,
QTextLine.CursorPosition arg__2)
cursorToX().
public final double y()
x(), rect(), textLength(), and width().
public final void draw(QPainter painter,
QPointF position)
public QTextLine clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||