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  · 

QTextLength Class Reference

The QTextLength class encapsulates the different types of length used in a QTextDocument. More...

 #include <QTextLength>

Note: All functions in this class are reentrant.

Public Types

enum Type { VariableLength, FixedLength, PercentageLength }

Public Functions

QTextLength ()
QTextLength ( Type type, qreal value )
qreal rawValue () const
Type type () const
qreal value ( qreal maximumLength ) const
operator QVariant () const
bool operator!= ( const QTextLength & other ) const
bool operator== ( const QTextLength & other ) const

Detailed Description

The QTextLength class encapsulates the different types of length used in a QTextDocument.

When we specify a value for the length of an element in a text document, we often need to provide some other information so that the length is used in the way we expect. For example, when we specify a table width, the value can represent a fixed number of pixels, or it can be a percentage value. This information changes both the meaning of the value and the way it is used.

Generally, this class is used to specify table widths. These can be specified either as a fixed amount of pixels, as a percentage of the containing frame's width, or by a variable width that allows it to take up just the space it requires.

See also QTextTable.

Member Type Documentation

enum QTextLength::Type

This enum describes the different types a length object can have.

ConstantValueDescription
QTextLength::VariableLength0The width of the object is variable
QTextLength::FixedLength1The width of the object is fixed
QTextLength::PercentageLength2The width of the object is in percentage of the maximum width

See also type().

Member Function Documentation

QTextLength::QTextLength ()

Constructs a new length object which represents a variable size.

QTextLength::QTextLength ( Type type, qreal value )

Constructs a new length object of the given type and value.

qreal QTextLength::rawValue () const

Returns the constraint value that is specific for the type of the length. If the length is QTextLength::PercentageLength then the raw value is in percent, in the range of 0 to 100. If the length is QTextLength::FixedLength then that fixed amount is returned. For variable lengths, zero is returned.

Type QTextLength::type () const

Returns the type of this length object.

See also QTextLength::Type.

qreal QTextLength::value ( qreal maximumLength ) const

Returns the effective length, constrained by the type of the length object and the specified maximumLength.

See also type().

QTextLength::operator QVariant () const

Returns the text length as a QVariant

bool QTextLength::operator!= ( const QTextLength & other ) const

Returns true if this text length is different from the other text length.

bool QTextLength::operator== ( const QTextLength & other ) const

Returns true if this text length is the same as the other text length.

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