CopperSpice API  1.9.1
QTextOption Class Reference

The QTextOption class provides a description of general rich text properties. More...

Classes

class  Tab
 Structure which represents a tab stop More...
 

Public Types

enum  TabType
 
enum  WrapMode
 

Public Methods

 QTextOption ()
 
 QTextOption (const QTextOption &other)
 
 QTextOption (Qt::Alignment alignment)
 
 ~QTextOption ()
 
Qt::Alignment alignment () const
 
Flags flags () const
 
QTextOption & operator= (const QTextOption &other)
 
void setAlignment (Qt::Alignment alignment)
 
void setFlags (Flags flags)
 
void setTabArray (const QList< qreal > &tabStops)
 
void setTabs (const QList< Tab > &tabStops)
 
void setTabStop (qreal tabStop)
 
void setTextDirection (Qt::LayoutDirection layoutDirection)
 
void setUseDesignMetrics (bool enable)
 
void setWrapMode (WrapMode mode)
 
QList< qrealtabArray () const
 
QList< Tabtabs () const
 
qreal tabStop () const
 
Qt::LayoutDirection textDirection () const
 
bool useDesignMetrics () const
 
WrapMode wrapMode () const
 

Detailed Description

The QTextOption class provides a description of general rich text properties. QTextOption is used to encapsulate common rich text properties in a single object. It contains information about text alignment, layout direction, word wrapping, and other standard properties associated with text rendering and layout.

See also
QTextEdit, QTextDocument, QTextCursor

Member Enumeration Documentation

This enum holds the different types of tabulator

ConstantValueDescription
QTextOption::LeftTab0 A left-tab
QTextOption::RightTab1 A right-tab
QTextOption::CenterTab2 A centered-tab
QTextOption::DelimiterTab3 A tab stopping at a certain delimiter-character

This enum describes how text is wrapped in a document.

ConstantValueDescription
QTextOption::NoWrap0 Text is not wrapped at all.
QTextOption::WordWrap1 Text is wrapped at word boundaries.
QTextOption::ManualWrap2 Same as QTextOption::NoWrap
QTextOption::WrapAnywhere3 Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
QTextOption::WrapAtWordBoundaryOrAnywhere4 If possible wrapping occurs at a word boundary, otherwise it will occur at the appropriate point on the line, even in the middle of a word.

Constructor & Destructor Documentation

QTextOption::QTextOption ( )

Constructs a text option with default properties for text. The text alignment property is set to Qt::AlignLeft. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.

QTextOption::QTextOption ( Qt::Alignment  alignment)

Constructs a text option with the given alignment for text. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.

QTextOption::~QTextOption ( )

Destroys the text option.

QTextOption::QTextOption ( const QTextOption &  other)

Construct a copy of the other text option.

Method Documentation

Qt::Alignment QTextOption::alignment ( ) const
inline

Returns the text alignment defined by the option.

See also
setAlignment()
Flags QTextOption::flags ( ) const
inline

Returns the flags associated with the option.

See also
setFlags()
QTextOption & QTextOption::operator= ( const QTextOption &  other)

Returns true if the text option is the same as the other text option, otherwise returns false.

void QTextOption::setAlignment ( Qt::Alignment  alignment)
inline

Sets the option's text alignment to the specified alignment.

See also
alignment()
void QTextOption::setFlags ( Flags  flags)
inline

Sets the flags associated with the option to the given flags.

See also
flags()
void QTextOption::setTabArray ( const QList< qreal > &  tabStops)

Sets the tab positions for the text layout to those specified by tabStops.

See also
tabArray(), setTabStop(), setTabs()
void QTextOption::setTabs ( const QList< Tab > &  tabStops)

Set the Tab properties to tabStops.

See also
tabStop(), tabs()
void QTextOption::setTabStop ( qreal  tabStop)
inline

Sets the default distance in device units between tab stops to the value specified by tabStop.

See also
tabStop(), setTabArray(), setTabs(), tabs()
void QTextOption::setTextDirection ( Qt::LayoutDirection  layoutDirection)
inline

Sets the direction of the text layout defined by the option to the given layoutDirection.

See also
textDirection()
void QTextOption::setUseDesignMetrics ( bool  enable)
inline

If enable is true then the layout will use design metrics, otherwise it will use the metrics of the paint device, this is the default behavior.

See also
useDesignMetrics()
void QTextOption::setWrapMode ( WrapMode  mode)
inline

Sets the option's text wrap mode to the given mode.

See also
wrapMode()
QList< qreal > QTextOption::tabArray ( ) const

Returns a list of tab positions defined for the text layout.

See also
setTabArray(), tabStop()
QList< Tab > QTextOption::tabs ( ) const

Returns a list of tab positions defined for the text layout.

See also
tabStop(), setTabs(), setTabStop()
qreal QTextOption::tabStop ( ) const
inline

Returns the distance in device units between tab stops. Convenient function for the above method

See also
setTabStop(), tabArray(), setTabs(), tabs()
Qt::LayoutDirection QTextOption::textDirection ( ) const
inline

Returns the direction of the text layout defined by the option.

See also
setTextDirection()
bool QTextOption::useDesignMetrics ( ) const
inline

Returns true if the layout uses design rather than device metrics, otherwise returns false.

See also
setUseDesignMetrics()
WrapMode QTextOption::wrapMode ( ) const
inline

Returns the text wrap mode defined by the option.

See also
setWrapMode()