<class name="QTextList" doc="/** <p>The <a href="QTextList.html#QTextList(com.trolltech.qt.gui.QTextDocument)"><tt>QTextList</tt></a> class provides a decorated list of items in a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>.</p> <p>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.</p> <p>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 <tt>QTextCursor::insertList</tt> function inserts an empty block into the document at the cursor position, and makes it the first item in a list.</p> <pre> QTextListFormat listFormat; if (list) { listFormat = list-&gt;format(); listFormat.setIndent(listFormat.indent() + 1); } listFormat.setStyle(QTextListFormat::ListDisc); cursor.insertList(listFormat);</pre> <p>The <tt>QTextCursor::createList</tt> function takes the contents of the cursor's current block and turns it into the first item of a new list.</p> <p>The cursor's current list is found with <tt>QTextCursor::currentList</tt>.</p> <p>The number of items in a list is given by <a href="QTextList.html#count()"><tt>count</tt></a>. Each item can be obtained by its index in the list with the <a href="QTextList.html#item(int)"><tt>item</tt></a> function. Similarly, the index of a given item can be found with <a href="QTextList.html#itemNumber(com.trolltech.qt.gui.QTextBlock)"><tt>itemNumber</tt></a>. The text of each item can be found with the <a href="QTextList.html#itemText(com.trolltech.qt.gui.QTextBlock)"><tt>itemText</tt></a> function.</p> <p>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.</p> <p>List items can be deleted by index with the <a href="QTextList.html#removeItem(int)"><tt>removeItem</tt></a> function. <a href="QTextList.html#remove(com.trolltech.qt.gui.QTextBlock)"><tt>remove</tt></a> deletes the specified item in the list.</p> <p>The list's format is set with <a href="QTextList.html#setFormat(com.trolltech.qt.gui.QTextListFormat)"><tt>setFormat</tt></a> and read with <a href="QTextObject.html#format()"><tt>format</tt></a>. The format describes the decoration of the list itself, and not the individual items.</p> @see <a href="QTextBlock.html"><tt>QTextBlock</tt></a> @see <a href="QTextListFormat.html"><tt>QTextListFormat</tt></a> @see <a href="QTextCursor.html"><tt>QTextCursor</tt></a> */"> <method name="public QTextList(com.trolltech.qt.gui.QTextDocument doc)" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> */"/> <method name="public final void add(com.trolltech.qt.gui.QTextBlock block)" doc="/** <p>Makes the given <tt>block</tt> part of the list.</p> @see <a href="QTextList.html#remove(com.trolltech.qt.gui.QTextBlock)"><tt>remove</tt></a> @see <a href="QTextList.html#removeItem(int)"><tt>removeItem</tt></a> */"/> <method name="public final int count()" doc="/** <p>Returns the number of items in the list.</p> @see <tt>isEmpty</tt> */"/> <method name="public final com.trolltech.qt.gui.QTextListFormat textListFormat()" doc="/** <p>Returns the list's format.</p> */"/> <method name="public final com.trolltech.qt.gui.QTextBlock item(int i)" doc="/** <p>Returns the <tt>i</tt>-th text block in the list.</p> @see <a href="QTextList.html#count()"><tt>count</tt></a> @see <a href="QTextList.html#itemText(com.trolltech.qt.gui.QTextBlock)"><tt>itemText</tt></a> */"/> <method name="public final int itemNumber(com.trolltech.qt.gui.QTextBlock arg__1)" doc="/** <p>Returns the index of the list item that corresponds to the given <tt>arg__1</tt>.</p> */"/> <method name="public final java.lang.String itemText(com.trolltech.qt.gui.QTextBlock arg__1)" doc="/** <p>Returns the text of the list item that corresponds to the given <tt>arg__1</tt>.</p> */"/> <method name="public final void remove(com.trolltech.qt.gui.QTextBlock arg__1)" doc="/** <p>Removes the given <tt>arg__1</tt> from the list.</p> @see <a href="QTextList.html#add(com.trolltech.qt.gui.QTextBlock)"><tt>add</tt></a> @see <a href="QTextList.html#removeItem(int)"><tt>removeItem</tt></a> */"/> <method name="public final void removeItem(int i)" doc="/** <p>Removes the item at item position <tt>i</tt> from the list. When the last item in the list is removed, the list is automatically deleted by the <a href="QTextDocument.html"><tt>QTextDocument</tt></a> that owns it.</p> @see <a href="QTextList.html#add(com.trolltech.qt.gui.QTextBlock)"><tt>add</tt></a> @see <a href="QTextList.html#remove(com.trolltech.qt.gui.QTextBlock)"><tt>remove</tt></a> */"/> <method name="public final void setFormat(com.trolltech.qt.gui.QTextListFormat format)" doc="/** <p>Sets the list's format to <tt>format</tt>.</p> */"/> </class>