QTextList Class ReferenceThe QTextList class provides a decorated list of items in a QTextDocument. More... #include <QTextList> Inherits: QTextBlockGroup. Note: All functions in this class are reentrant. Public Functions
Additional Inherited Members
Detailed DescriptionThe 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; if (list) { listFormat = list->format(); listFormat.setIndent(listFormat.indent() + 1); } listFormat.setStyle(QTextListFormat::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. See also QTextBlock, QTextListFormat, and QTextCursor. Member Function Documentation
|
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.8 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com