FormatRange Class

(QTextLayout::FormatRange)

The QTextLayout::FormatRange structure is used to apply extra formatting information for a specified area in the text layout's content. 更多...

头文件: #include <FormatRange>
qmake: QT += gui

公有变量

QTextCharFormat format
int length
int start
bool operator!=(const FormatRange &lhs, const FormatRange &rhs)
bool operator==(const FormatRange &lhs, const FormatRange &rhs)

详细描述

The QTextLayout::FormatRange structure is used to apply extra formatting information for a specified area in the text layout's content.

参见 QTextLayout::setFormats() and QTextLayout::draw().

成员变量

QTextCharFormat FormatRange::format

Specifies the format to apply.

int FormatRange::length

Specifies the numer of characters the format range spans.

int FormatRange::start

Specifies the beginning of the format range within the text layout's text.

相关非成员

bool QTextLayout::operator!=(const FormatRange &lhs, const FormatRange &rhs)

Returns true if any of the start, length, or format fields in lhs and rhs contain different values respectively.

bool QTextLayout::operator==(const FormatRange &lhs, const FormatRange &rhs)

Returns true if the start, length, and format fields in lhs and rhs contain the same values respectively.