Qt:Документация 4.3.2/qtextlength

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QTextLength Class Reference
[модуль QtGui ]

The QTextLength class encapsulates the different types of length used in a QTextDocument. Далее...

 #include <QTextLength>

[править] Открытые типы

  • enum Type { VariableLength, FixedLength, PercentageLength }

[править] Открытые функции


[править] Подробное описание

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.


[править] Описание типов

[править]
enum QTextLength::Type

Константа Значение
QTextLength::VariableLength 0
QTextLength::FixedLength 1
QTextLength::PercentageLength 2

[править] Описание функций-членов

[править]
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 length.

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.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2