![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\reentrant More...
#include <qtextformat.h>
Public Member Functions | |
QTextListFormat () | |
Constructs a new list format object. | |
bool | isValid () const |
Returns true if this list format is valid; otherwise returns false . | |
void | setStyle (Style style) |
Sets the list format's style. | |
Style | style () const |
Returns the list format's style. | |
void | setIndent (int indent) |
Sets the list format's indentation. | |
int | indent () const |
Returns the list format's indentation. | |
void | setNumberPrefix (const QString &numberPrefix) |
QString | numberPrefix () const |
void | setNumberSuffix (const QString &numberSuffix) |
QString | numberSuffix () const |
void | setStart (int indent) |
int | start () const |
![]() | |
QTextFormat () | |
Creates a new text format with an InvalidFormat . | |
QTextFormat (int type) | |
Creates a new text format of the given type. | |
QTextFormat (const QTextFormat &rhs) | |
Creates a new text format with the same attributes as the other text format. | |
QTextFormat & | operator= (const QTextFormat &rhs) |
Assigns the other text format to this text format, and returns a reference to this text format. | |
~QTextFormat () | |
Destroys this text format. | |
void | swap (QTextFormat &other) |
void | merge (const QTextFormat &other) |
Merges the other format with this format; where there are conflicts the other format takes precedence. | |
bool | isValid () const |
Returns true if the format is valid (i.e. | |
bool | isEmpty () const |
int | type () const |
Returns the type of this format. | |
int | objectIndex () const |
Returns the index of the format object, or -1 if the format object is invalid. | |
void | setObjectIndex (int object) |
Sets the format object's object index. | |
QVariant | property (int propertyId) const |
Returns the property specified by the given propertyId. | |
void | setProperty (int propertyId, const QVariant &value) |
Sets the property specified by the propertyId to the given value. | |
void | clearProperty (int propertyId) |
Clears the value of the property given by propertyId. | |
bool | hasProperty (int propertyId) const |
Returns true if the text format has a property with the given propertyId; otherwise returns false . | |
bool | boolProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
int | intProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
qreal | doubleProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
QString | stringProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QString type, an empty string is returned instead. | |
QColor | colorProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QColor type, an invalid color is returned instead. | |
QPen | penProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QPen type, Qt::NoPen is returned instead. | |
QBrush | brushProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QBrush type, Qt::NoBrush is returned instead. | |
QTextLength | lengthProperty (int propertyId) const |
Returns the value of the property given by propertyId. | |
QList< QTextLength > | lengthVectorProperty (int propertyId) const |
Returns the value of the property given by propertyId. | |
void | setProperty (int propertyId, const QList< QTextLength > &lengths) |
Sets the value of the property given by propertyId to value. | |
QMap< int, QVariant > | properties () const |
Returns a map with all properties of this text format. | |
int | propertyCount () const |
void | setObjectType (int type) |
Sets the text format's object type to type. | |
int | objectType () const |
Returns the text format's object type. | |
bool | isCharFormat () const |
Returns true if this text format is a CharFormat ; otherwise returns false . | |
bool | isBlockFormat () const |
Returns true if this text format is a BlockFormat ; otherwise returns false . | |
bool | isListFormat () const |
Returns true if this text format is a ListFormat ; otherwise returns false . | |
bool | isFrameFormat () const |
Returns true if this text format is a FrameFormat ; otherwise returns false . | |
bool | isImageFormat () const |
Returns true if this text format is an image format; otherwise returns false . | |
bool | isTableFormat () const |
Returns true if this text format is a TableFormat ; otherwise returns false . | |
bool | isTableCellFormat () const |
QTextBlockFormat | toBlockFormat () const |
Returns this format as a block format. | |
QTextCharFormat | toCharFormat () const |
Returns this format as a character format. | |
QTextListFormat | toListFormat () const |
Returns this format as a list format. | |
QTextTableFormat | toTableFormat () const |
Returns this format as a table format. | |
QTextFrameFormat | toFrameFormat () const |
Returns this format as a frame format. | |
QTextImageFormat | toImageFormat () const |
Returns this format as an image format. | |
QTextTableCellFormat | toTableCellFormat () const |
bool | operator== (const QTextFormat &rhs) const |
Returns true if this text format is the same as the other text format. | |
bool | operator!= (const QTextFormat &rhs) const |
Returns true if this text format is different from the other text format. | |
operator QVariant () const | |
Returns the text format as a QVariant. | |
void | setLayoutDirection (Qt::LayoutDirection direction) |
Sets the document's layout direction to the specified direction. | |
Qt::LayoutDirection | layoutDirection () const |
Returns the document's layout direction. | |
void | setBackground (const QBrush &brush) |
Sets the brush use to paint the document's background to the brush specified. | |
QBrush | background () const |
Returns the brush used to paint the document's background. | |
void | clearBackground () |
Clears the brush used to paint the document's background. | |
void | setForeground (const QBrush &brush) |
Sets the foreground brush to the specified brush. | |
QBrush | foreground () const |
Returns the brush used to render foreground details, such as text, frame outlines, and table borders. | |
void | clearForeground () |
Clears the brush used to paint the document's foreground. | |
Protected Member Functions | |
QTextListFormat (const QTextFormat &fmt) | |
Friends | |
class | QTextFormat |
\reentrant
The QTextListFormat class provides formatting information for lists in a QTextDocument. \inmodule QtGui
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, unless it has been overridden via setStart().
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.:
Definition at line 723 of file qtextformat.h.
This enum describes the symbols used to decorate list items:
\value ListDisc a filled circle \value ListCircle an empty circle \value ListSquare a filled square \value ListDecimal decimal values in ascending order \value ListLowerAlpha lower case Latin characters in alphabetical order \value ListUpperAlpha upper case Latin characters in alphabetical order \value ListLowerRoman lower case roman numerals (supports up to 4999 items only) \value ListUpperRoman upper case roman numerals (supports up to 4999 items only) \omitvalue ListStyleUndefined
Enumerator | |
---|---|
ListDisc | |
ListCircle | |
ListSquare | |
ListDecimal | |
ListLowerAlpha | |
ListUpperAlpha | |
ListLowerRoman | |
ListUpperRoman | |
ListStyleUndefined |
Definition at line 730 of file qtextformat.h.
QTextListFormat::QTextListFormat | ( | ) |
Constructs a new list format object.
Definition at line 2644 of file qtextformat.cpp.
|
explicitprotected |
Creates a new list format with the same attributes as the given text format.
Definition at line 2658 of file qtextformat.cpp.
|
inline |
Returns the list format's indentation.
The indentation is multiplied by the QTextDocument::indentWidth property to get the effective indent in pixels.
Definition at line 747 of file qtextformat.h.
|
inline |
Returns true
if this list format is valid; otherwise returns false
.
Definition at line 728 of file qtextformat.h.
|
inline |
Returns the list format's number prefix.
Definition at line 751 of file qtextformat.h.
|
inline |
Returns the list format's number suffix.
Definition at line 755 of file qtextformat.h.
|
inline |
Sets the list format's indentation.
The indentation is multiplied by the QTextDocument::indentWidth property to get the effective indent in pixels.
Definition at line 771 of file qtextformat.h.
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.
Definition at line 774 of file qtextformat.h.
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 ".".
Definition at line 777 of file qtextformat.h.
|
inline |
Sets the list format's start index.
This allows you to start a list with an index other than 1. This can be used with all sorted list types: for example if the style() is QTextListFormat::ListLowerAlpha and start() is 4
, the first list item begins with "d". It does not have any effect on unsorted list types.
The default start is 1
.
Definition at line 780 of file qtextformat.h.
|
inline |
Returns the number to be shown by the first list item, if the style() is QTextListFormat::ListDecimal, or to offset other sorted list types.
Definition at line 759 of file qtextformat.h.
|
inline |
Returns the list format's style.
Definition at line 743 of file qtextformat.h.
|
friend |
Definition at line 763 of file qtextformat.h.