|
|||||||||
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.core.QObject
com.trolltech.qt.gui.QTextObject
com.trolltech.qt.gui.QTextBlockGroup
com.trolltech.qt.gui.QTextList
public class QTextList
The QTextList
class provides a decorated list of items in a QTextDocument
. A list contains a sequence of text blocks, each of which is marked with a bullet point or other symbol. Multiple levels of lists can be used, and the automatic numbering feature provides support for ordered numeric and alphabetical lists.
Lists are created by using a text cursor to insert an empty list at the current position or by moving existing text into a new list. The QTextCursor::insertList()
function inserts an empty block into the document at the cursor position, and makes it the first item in a list.
QTextListFormat listFormat = new QTextListFormat(); if (list != null) { listFormat = list.format(); listFormat.setIndent(listFormat.indent() + 1); } listFormat.setStyle(QTextListFormat.Style.ListDisc); cursor.insertList(listFormat);The
QTextCursor::createList()
function takes the contents of the cursor's current block and turns it into the first item of a new list. The cursor's current list is found with QTextCursor::currentList()
.
The number of items in a list is given by count()
. Each item can be obtained by its index in the list with the item()
function. Similarly, the index of a given item can be found with itemNumber()
. The text of each item can be found with the itemText()
function.
Note that the items in the list may not be adjacent elements in the document. For example, the top-level items in a multi-level list will be separated by the items in lower levels of the list.
List items can be deleted by index with the removeItem()
function. remove()
deletes the specified item in the list.
The list's format is set with setFormat()
and read with format(). The format describes the decoration of the list itself, and not the individual items.
QTextBlock
, QTextListFormat
, and QTextCursor
.
Nested Class Summary |
---|
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 |
Method Summary | |
---|---|
void |
add(QTextBlock block)
Makes the given block part of the list. |
int |
count()
Returns the number of items in the list. |
QTextBlock |
item(int i)
Returns the i-th text block in the list. |
int |
itemNumber(QTextBlock arg__1)
Returns the index of the list item that corresponds to the given block. |
java.lang.String |
itemText(QTextBlock arg__1)
Returns the text of the list item that corresponds to the given block. |
void |
remove(QTextBlock arg__1)
Removes the given block from the list. |
void |
removeItem(int i)
Removes the item at item position i from the list. |
void |
setFormat(QTextListFormat format)
Sets the list's format to format. |
QTextListFormat |
textListFormat()
Returns the list's format. |
Methods inherited from class com.trolltech.qt.gui.QTextBlockGroup |
---|
blockFormatChanged, blockInserted, blockList, blockRemoved |
Methods inherited from class com.trolltech.qt.gui.QTextObject |
---|
document, format, formatIndex, objectIndex, setFormat |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
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 |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Method Detail |
---|
public final void add(QTextBlock block)
remove()
, and removeItem()
.
public final int count()
public final QTextListFormat textListFormat()
setFormat()
.
public final QTextBlock item(int i)
count()
, and itemText()
.
public final int itemNumber(QTextBlock arg__1)
public final java.lang.String itemText(QTextBlock arg__1)
public final void remove(QTextBlock arg__1)
add()
, and removeItem()
.
public final void removeItem(int i)
QTextDocument
that owns it. add()
, and remove()
.
public final void setFormat(QTextListFormat format)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |