QtBase  v6.3.1
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
QTextListFormat Class Reference

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

#include <qtextformat.h>

Inheritance diagram for QTextListFormat:
Inheritance graph
[legend]
Collaboration diagram for QTextListFormat:
Collaboration graph
[legend]

Public Types

enum  Style {
  ListDisc = -1 , ListCircle = -2 , ListSquare = -3 , ListDecimal = -4 ,
  ListLowerAlpha = -5 , ListUpperAlpha = -6 , ListLowerRoman = -7 , ListUpperRoman = -8 ,
  ListStyleUndefined = 0
}
 
- Public Types inherited from QTextFormat
enum  FormatType {
  InvalidFormat = -1 , BlockFormat = 1 , CharFormat = 2 , ListFormat = 3 ,
  FrameFormat = 5 , UserFormat = 100
}
 
enum  Property {
  ObjectIndex = 0x0 , CssFloat = 0x0800 , LayoutDirection = 0x0801 , OutlinePen = 0x810 ,
  BackgroundBrush = 0x820 , ForegroundBrush = 0x821 , BackgroundImageUrl = 0x823 , BlockAlignment = 0x1010 ,
  BlockTopMargin = 0x1030 , BlockBottomMargin = 0x1031 , BlockLeftMargin = 0x1032 , BlockRightMargin = 0x1033 ,
  TextIndent = 0x1034 , TabPositions = 0x1035 , BlockIndent = 0x1040 , LineHeight = 0x1048 ,
  LineHeightType = 0x1049 , BlockNonBreakableLines = 0x1050 , BlockTrailingHorizontalRulerWidth = 0x1060 , HeadingLevel = 0x1070 ,
  BlockQuoteLevel = 0x1080 , BlockCodeLanguage = 0x1090 , BlockCodeFence = 0x1091 , BlockMarker = 0x10A0 ,
  FirstFontProperty = 0x1FE0 , FontCapitalization = FirstFontProperty , FontLetterSpacing = 0x1FE1 , FontWordSpacing = 0x1FE2 ,
  FontStyleHint = 0x1FE3 , FontStyleStrategy = 0x1FE4 , FontKerning = 0x1FE5 , FontHintingPreference = 0x1FE6 ,
  FontFamilies = 0x1FE7 , FontStyleName = 0x1FE8 , FontLetterSpacingType = 0x1FE9 , FontStretch = 0x1FEA ,
  FontPointSize = 0x2001 , FontSizeAdjustment = 0x2002 , FontSizeIncrement = FontSizeAdjustment , FontWeight = 0x2003 ,
  FontItalic = 0x2004 , FontUnderline = 0x2005 , FontOverline = 0x2006 , FontStrikeOut = 0x2007 ,
  FontFixedPitch = 0x2008 , FontPixelSize = 0x2009 , LastFontProperty = FontPixelSize , TextUnderlineColor = 0x2020 ,
  TextVerticalAlignment = 0x2021 , TextOutline = 0x2022 , TextUnderlineStyle = 0x2023 , TextToolTip = 0x2024 ,
  TextSuperScriptBaseline = 0x2025 , TextSubScriptBaseline = 0x2026 , TextBaselineOffset = 0x2027 , IsAnchor = 0x2030 ,
  AnchorHref = 0x2031 , AnchorName = 0x2032 , OldFontLetterSpacingType = 0x2033 , OldFontStretch = 0x2034 ,
  OldTextUnderlineColor = 0x2010 , ObjectType = 0x2f00 , ListStyle = 0x3000 , ListIndent = 0x3001 ,
  ListNumberPrefix = 0x3002 , ListNumberSuffix = 0x3003 , FrameBorder = 0x4000 , FrameMargin = 0x4001 ,
  FramePadding = 0x4002 , FrameWidth = 0x4003 , FrameHeight = 0x4004 , FrameTopMargin = 0x4005 ,
  FrameBottomMargin = 0x4006 , FrameLeftMargin = 0x4007 , FrameRightMargin = 0x4008 , FrameBorderBrush = 0x4009 ,
  FrameBorderStyle = 0x4010 , TableColumns = 0x4100 , TableColumnWidthConstraints = 0x4101 , TableCellSpacing = 0x4102 ,
  TableCellPadding = 0x4103 , TableHeaderRowCount = 0x4104 , TableBorderCollapse = 0x4105 , TableCellRowSpan = 0x4810 ,
  TableCellColumnSpan = 0x4811 , TableCellTopPadding = 0x4812 , TableCellBottomPadding = 0x4813 , TableCellLeftPadding = 0x4814 ,
  TableCellRightPadding = 0x4815 , TableCellTopBorder = 0x4816 , TableCellBottomBorder = 0x4817 , TableCellLeftBorder = 0x4818 ,
  TableCellRightBorder = 0x4819 , TableCellTopBorderStyle = 0x481a , TableCellBottomBorderStyle = 0x481b , TableCellLeftBorderStyle = 0x481c ,
  TableCellRightBorderStyle = 0x481d , TableCellTopBorderBrush = 0x481e , TableCellBottomBorderBrush = 0x481f , TableCellLeftBorderBrush = 0x4820 ,
  TableCellRightBorderBrush = 0x4821 , ImageName = 0x5000 , ImageTitle = 0x5001 , ImageAltText = 0x5002 ,
  ImageWidth = 0x5010 , ImageHeight = 0x5011 , ImageQuality = 0x5014 , FullWidthSelection = 0x06000 ,
  PageBreakPolicy = 0x7000 , UserProperty = 0x100000
}
 
enum  ObjectTypes {
  NoObject , ImageObject , TableObject , TableCellObject ,
  UserObject = 0x1000
}
 
enum  PageBreakFlag { PageBreak_Auto = 0 , PageBreak_AlwaysBefore = 0x001 , PageBreak_AlwaysAfter = 0x010 }
 

Public Member Functions

 QTextListFormat ()
 
bool isValid () const
 
void setStyle (Style style)
 
Style style () const
 
void setIndent (int indent)
 
int indent () const
 
void setNumberPrefix (const QString &numberPrefix)
 
QString numberPrefix () const
 
void setNumberSuffix (const QString &numberSuffix)
 
QString numberSuffix () const
 
- Public Member Functions inherited from QTextFormat
 QTextFormat ()
 
 QTextFormat (int type)
 
 QTextFormat (const QTextFormat &rhs)
 
QTextFormatoperator= (const QTextFormat &rhs)
 
 ~QTextFormat ()
 
void swap (QTextFormat &other)
 
void merge (const QTextFormat &other)
 
bool isValid () const
 
bool isEmpty () const
 
int type () const
 
int objectIndex () const
 
void setObjectIndex (int object)
 
QVariant property (int propertyId) const
 
void setProperty (int propertyId, const QVariant &value)
 
void clearProperty (int propertyId)
 
bool hasProperty (int propertyId) const
 
bool boolProperty (int propertyId) const
 
int intProperty (int propertyId) const
 
qreal doubleProperty (int propertyId) const
 
QString stringProperty (int propertyId) const
 
QColor colorProperty (int propertyId) const
 
QPen penProperty (int propertyId) const
 
QBrush brushProperty (int propertyId) const
 
QTextLength lengthProperty (int propertyId) const
 
QList< QTextLengthlengthVectorProperty (int propertyId) const
 
void setProperty (int propertyId, const QList< QTextLength > &lengths)
 
QMap< int, QVariantproperties () const
 
int propertyCount () const
 
void setObjectType (int type)
 
int objectType () const
 
bool isCharFormat () const
 
bool isBlockFormat () const
 
bool isListFormat () const
 
bool isFrameFormat () const
 
bool isImageFormat () const
 
bool isTableFormat () const
 
bool isTableCellFormat () const
 
QTextBlockFormat toBlockFormat () const
 
QTextCharFormat toCharFormat () const
 
QTextListFormat toListFormat () const
 
QTextTableFormat toTableFormat () const
 
QTextFrameFormat toFrameFormat () const
 
QTextImageFormat toImageFormat () const
 
QTextTableCellFormat toTableCellFormat () const
 
bool operator== (const QTextFormat &rhs) const
 
bool operator!= (const QTextFormat &rhs) const
 
 operator QVariant () const
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
Qt::LayoutDirection layoutDirection () const
 
void setBackground (const QBrush &brush)
 
QBrush background () const
 
void clearBackground ()
 
void setForeground (const QBrush &brush)
 
QBrush foreground () const
 
void clearForeground ()
 

Protected Member Functions

 QTextListFormat (const QTextFormat &fmt)
 

Friends

class QTextFormat
 

Detailed Description

The QTextListFormat class provides formatting information for lists in a QTextDocument. \inmodule QtGui.

\reentrant

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.:

See also
QTextList

Definition at line 756 of file qtextformat.h.

Member Enumeration Documentation

◆ Style

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 763 of file qtextformat.h.

Constructor & Destructor Documentation

◆ QTextListFormat() [1/2]

QTextListFormat::QTextListFormat ( )

Constructs a new list format object.

Definition at line 2681 of file qtextformat.cpp.

Here is the call graph for this function:

◆ QTextListFormat() [2/2]

QTextListFormat::QTextListFormat ( const QTextFormat fmt)
explicitprotected

Definition at line 2694 of file qtextformat.cpp.

Member Function Documentation

◆ indent()

int QTextListFormat::indent ( ) const
inline

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()

Definition at line 780 of file qtextformat.h.

Here is the caller graph for this function:

◆ isValid()

bool QTextListFormat::isValid ( ) const
inline

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

Definition at line 761 of file qtextformat.h.

◆ numberPrefix()

int QTextListFormat::numberPrefix ( ) const
inline
Since
4.8

Returns the list format's number prefix.

See also
setNumberPrefix()

Definition at line 784 of file qtextformat.h.

Here is the caller graph for this function:

◆ numberSuffix()

int QTextListFormat::numberSuffix ( ) const
inline
Since
4.8

Returns the list format's number suffix.

See also
setNumberSuffix()

Definition at line 788 of file qtextformat.h.

Here is the caller graph for this function:

◆ setIndent()

void QTextListFormat::setIndent ( int  indentation)
inline

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()

Definition at line 801 of file qtextformat.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNumberPrefix()

void QTextListFormat::setNumberPrefix ( const QString numberPrefix)
inline
Since
4.8

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.

See also
numberPrefix()

Definition at line 804 of file qtextformat.h.

Here is the call graph for this function:

◆ setNumberSuffix()

void QTextListFormat::setNumberSuffix ( const QString numberSuffix)
inline
Since
4.8

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 ".".

See also
numberSuffix()

Definition at line 807 of file qtextformat.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStyle()

void QTextListFormat::setStyle ( Style  style)
inline

Sets the list format's style.

See also
style(), Style

Definition at line 798 of file qtextformat.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ style()

Style QTextListFormat::style ( ) const
inline

Returns the list format's style.

See also
setStyle(), Style

Definition at line 776 of file qtextformat.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ QTextFormat

friend class QTextFormat
friend

Definition at line 793 of file qtextformat.h.


The documentation for this class was generated from the following files: