Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QTextListFormat Class Reference

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

 #include <QTextListFormat>

Inherits: QTextFormat.

Note: All functions in this class are reentrant.

Public Types

enum Style { ListDisc, ListCircle, ListSquare, ListDecimal, ..., ListUpperRoman }

Public Functions

QTextListFormat ()
int indent () const
bool isValid () const
QString numberPrefix () const
QString numberSuffix () const
void setIndent ( int indentation )
void setNumberPrefix ( const QString & numberPrefix )
void setNumberSuffix ( const QString & numberSuffix )
void setStyle ( Style style )
Style style () const

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.

Style properties can be set to further configure the appearance of list items; for example, the ListNumberPrefix and ListNumberSuffix properties can be used to customize the numbers used in an ordered list so that they appear as (1), (2), (3), etc.:

 QTextListFormat listFormat;

 listFormat.setStyle(QTextListFormat::ListDecimal);
 listFormat.setNumberPrefix("(");
 listFormat.setNumberSuffix(")");

 cursor.insertList(listFormat);

See also QTextList.

Member Type Documentation

enum QTextListFormat::Style

This enum describes the symbols used to decorate list items:

ConstantValueDescription
QTextListFormat::ListDisc-1a filled circle
QTextListFormat::ListCircle-2an empty circle
QTextListFormat::ListSquare-3a filled square
QTextListFormat::ListDecimal-4decimal values in ascending order
QTextListFormat::ListLowerAlpha-5lower case Latin characters in alphabetical order
QTextListFormat::ListUpperAlpha-6upper case Latin characters in alphabetical order
QTextListFormat::ListLowerRoman-7lower case roman numerals (supports up to 4999 items only)
QTextListFormat::ListUpperRoman-8upper case roman numerals (supports up to 4999 items only)

Member Function Documentation

QTextListFormat::QTextListFormat ()

Constructs a new list format object.

int QTextListFormat::indent () const

Returns the list format's indentation. The indentation is multiplied by the QTextDocument::indentWidth property to get the effective indent in pixels.

See also setIndent().

bool QTextListFormat::isValid () const

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

QString QTextListFormat::numberPrefix () const

Returns the list format's number prefix.

This function was introduced in Qt 4.8.

See also setNumberPrefix().

QString QTextListFormat::numberSuffix () const

Returns the list format's number suffix.

This function was introduced in Qt 4.8.

See also setNumberSuffix().

void QTextListFormat::setIndent ( int indentation )

Sets the list format's indentation. The indentation is multiplied by the QTextDocument::indentWidth property to get the effective indent in pixels.

See also indent().

void QTextListFormat::setNumberPrefix ( const QString & numberPrefix )

Sets the list format's number prefix to the string specified by numberPrefix. This can be used with all sorted list types. It does not have any effect on unsorted list types.

The default prefix is an empty string.

This function was introduced in Qt 4.8.

See also numberPrefix().

void QTextListFormat::setNumberSuffix ( const QString & numberSuffix )

Sets the list format's number suffix to the string specified by numberSuffix. This can be used with all sorted list types. It does not have any effect on unsorted list types.

The default suffix is ".".

This function was introduced in Qt 4.8.

See also numberSuffix().

void QTextListFormat::setStyle ( Style style )

Sets the list format's style.

See also style() and Style.

Style QTextListFormat::style () const

Returns the list format's style.

See also setStyle() and Style.

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 !
 
 
 
 
Partenaires

Hébergement Web