Documents > BPS V2 C++ API
BpsGraphicsRichtextItem Class Reference

Rich text item, based on QTextDocument. More...

#include <bpsgraphicsitem.h>

List of all members.

Public Member Functions

 BpsGraphicsRichtextItem (QGraphicsItem *aParent=0)
 Constructor for the class.
QFont defaultFont () const
Bps::Direction direction () const
QRectF handleRect () const
BpsMargins margins () const
int resolution () const
int roundness () const
void setDefaultFont (const QFont &aFont)
 Set a new default fond.
void setDirection (Bps::Direction aDirection)
 Set the new text direction.
void setHtml (const QString &aText)
 Set new content as html code.
void setMargins (const BpsMargins &aMargins)
 Set new margins.
void setPlainText (const QString &aText)
 Set new content as plain text.
void setResolution (int aResolution)
 Set the new resolution in DPI.
void setRoundness (int aRoundness)
 Define a new roundness for the rectangle corners.
void setTextWidth (qreal aWidth)
 Set the new text width.
qreal textWidth () const
QString toHtml () const
QString toPlainText () const

Detailed Description

Rich text item, based on QTextDocument.

Compared to QGraphicsTextItem, this class has an enclosing rectangle, margins, and can be rotated in all four directions.


Constructor & Destructor Documentation

BpsGraphicsRichtextItem::BpsGraphicsRichtextItem ( QGraphicsItem *  aParent = 0)

Constructor for the class.

Parameters:
[in]aParentParent item.

Member Function Documentation

QFont BpsGraphicsRichtextItem::defaultFont ( ) const
Returns:
The current default font.
Bps::Direction BpsGraphicsRichtextItem::direction ( ) const
Returns:
Returns the direction in which the text reads.
QRectF BpsGraphicsRichtextItem::handleRect ( ) const
Returns:
Returns the handle rectangle. For the rich text item this is identical to the frame shape.
BpsMargins BpsGraphicsRichtextItem::margins ( ) const
Returns:
Get the current margins.
int BpsGraphicsRichtextItem::resolution ( ) const
Returns:
Returns the current resolution. 0 stands for default (screen) resolution.
int BpsGraphicsRichtextItem::roundness ( ) const
Returns:
Get the current roundness.
void BpsGraphicsRichtextItem::setDefaultFont ( const QFont &  aFont)

Set a new default fond.

This font will be used for plain text and otherwise unformatted html text.

Parameters:
[in]aFontThe default font to set.
void BpsGraphicsRichtextItem::setDirection ( Bps::Direction  aDirection)

Set the new text direction.

Default is east.

Parameters:
[in]aDirectionThe new direction to set.
void BpsGraphicsRichtextItem::setHtml ( const QString &  aText)

Set new content as html code.

Parameters:
[in]aTextThe new content.
void BpsGraphicsRichtextItem::setMargins ( const BpsMargins aMargins)

Set new margins.

Parameters:
[in]aMarginsThe new margins to set.
void BpsGraphicsRichtextItem::setPlainText ( const QString &  aText)

Set new content as plain text.

Parameters:
[in]aTextThe new content to set.
void BpsGraphicsRichtextItem::setResolution ( int  aResolution)

Set the new resolution in DPI.

Parameters:
[in]aResolutionThe new resolution to set.
void BpsGraphicsRichtextItem::setRoundness ( int  aRoundness)

Define a new roundness for the rectangle corners.

The roundness is expressed in percent and can range from 0 to 100, where 0 is no roundness and 100 is maximum. The radius is calculated as percentage of the half of the shorter side of the rectangle.

Parameters:
[in]aRoundnessThe new roundness to set.
void BpsGraphicsRichtextItem::setTextWidth ( qreal  aWidth)

Set the new text width.

The height is calculated automatically depending on the amount of text.

Parameters:
[in]aWidthThe new text width (excluding margins).
qreal BpsGraphicsRichtextItem::textWidth ( ) const
Returns:
Get the current text width.
QString BpsGraphicsRichtextItem::toHtml ( ) const
Returns:
Return the current content as html.
QString BpsGraphicsRichtextItem::toPlainText ( ) const
Returns:
Return the current content as plain text, stripping any html.

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