|  | Home · All Classes · Modules

# QTextListFormat Class Reference
[QtGui module]

The QTextListFormat class provides formatting information for lists in a QTextDocument. More...

Inherits QTextFormat.

### Types

- enum Style { ListDisc, ListCircle, ListSquare, ListDecimal, ..., ListStyleUndefined }

### Methods

- __init__ (self)
- __init__ (self, QTextListFormat other)
- int indent (self)
- bool isValid (self)
- setIndent (self, int aindent)
- setStyle (self, Style astyle)
- Style style (self)

## Detailed Description

The QTextListFormat class provides formatting information for lists in a QTextDocument.

A list is composed of one or more items, represented as text blocks. The list's format specifies the appearance of items in the list. In particular, it determines the indentation and the style of each item.

The indentation of the items is an integer value that causes each item to be offset from the left margin by a certain amount. This value is read with indent() and set with setIndent().

The style used to decorate each item is set with setStyle() and can be read with the style() function. The style controls the type of bullet points and numbering scheme used for items in the list. Note that lists that use the decimal numbering scheme begin counting at 1 rather than 0.

See also QTextList.

## Type Documentation

### QTextListFormat.Style

This enum describes the symbols used to decorate list items:

Constant | Value | Description
--- | --- | ---
`QTextListFormat.ListDisc` | `-1` | a filled circle
`QTextListFormat.ListCircle` | `-2` | an empty circle
`QTextListFormat.ListSquare` | `-3` | a filled square
`QTextListFormat.ListDecimal` | `-4` | decimal values in ascending order
`QTextListFormat.ListLowerAlpha` | `-5` | lower case Latin characters in alphabetical order
`QTextListFormat.ListUpperAlpha` | `-6` | upper case Latin characters in alphabetical order

## Method Documentation

### QTextListFormat.__init__ (self)

Constructs a new list format object.

### QTextListFormat.__init__ (self, QTextListFormat other)

### int QTextListFormat.indent (self)

Returns the list format's indentation.

See also setIndent().

### bool QTextListFormat.isValid (self)

Returns true if this list format is valid; otherwise returns false.

### QTextListFormat.setIndent (self, int aindent)

Sets the list format's indentation.

See also indent().

### QTextListFormat.setStyle (self, Style astyle)

Sets the list format's style. See `Style` for the available styles.

See also style().

### Style QTextListFormat.style (self)

Returns the list format's style. See `Style`.

See also setStyle().