Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QTextList Class Reference

The QTextList class provides a list in a QTextDocument. More...

    #include <QTextList>

Inherits QTextBlockGroup.

- List of all members, including inherited members

### Writable Properties

- 1 writable property inherited from QObject

### Public Functions

- int count () const
- QTextListFormat format () const
- bool isEmpty () const
- QTextBlock item ( int i ) const
- int itemNumber ( const QTextBlock & blockIt ) const
- QString itemText ( const QTextBlock & blockIt ) const
- void remove ( const QTextBlock & block )
- void removeItem ( int i )
- void setFormat ( const QTextListFormat & format )

- 3 public functions inherited from QTextObject
- 24 public functions inherited from QObject

### Public Slots

- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QObject

### Protected Functions

- 4 protected functions inherited from QTextBlockGroup
- 1 protected function inherited from QTextObject
- 9 protected functions inherited from QObject

## Detailed Description

The QTextList class provides a list in a QTextDocument.

Lists can be created by QTextCursor::createList() and queried with QTextCursor::currentList().

The number of items in a list is given by count(). A cursor positioned at a given list item is returned by item(), and the text of a given list item is returned by itemText(). A list item can be deleted with removeItem(). The list's format is set with setFormat().

## Member Function Documentation

### int QTextList::count () const

Returns the number of items in the list.

See also isEmpty().

### QTextListFormat QTextList::format () const

Returns the list's format.

### bool QTextList::isEmpty () const

Returns true if the list has no items; otherwise returns false.

See also count().

### QTextBlock QTextList::item ( int i ) const

Returns a QTextCursor positioned at the i-th item in the list.

See also count(), item(), and itemText().

### int QTextList::itemNumber ( const QTextBlock & blockIt ) const

Returns the index of the list item at cursor position blockIt.

### QString QTextList::itemText ( const QTextBlock & blockIt ) const

Returns the text of the list item at cursor position blockIt.

### void QTextList::remove ( const QTextBlock & block )

Removes the block block from the list.

### void QTextList::removeItem ( int i )

Removes the item at item position i from the list.

### void QTextList::setFormat ( const QTextListFormat & format )

Sets the list's format to format.