Rich text item, based on QTextDocument. More...
#include <bpsgraphicsitem.h>
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 |
Rich text item, based on QTextDocument.
Compared to QGraphicsTextItem, this class has an enclosing rectangle, margins, and can be rotated in all four directions.
| BpsGraphicsRichtextItem::BpsGraphicsRichtextItem | ( | QGraphicsItem * | aParent = 0 | ) |
Constructor for the class.
| [in] | aParent | Parent item. |
| QFont BpsGraphicsRichtextItem::defaultFont | ( | ) | const |
| Bps::Direction BpsGraphicsRichtextItem::direction | ( | ) | const |
| QRectF BpsGraphicsRichtextItem::handleRect | ( | ) | const |
| BpsMargins BpsGraphicsRichtextItem::margins | ( | ) | const |
| int BpsGraphicsRichtextItem::resolution | ( | ) | const |
| int BpsGraphicsRichtextItem::roundness | ( | ) | const |
| void BpsGraphicsRichtextItem::setDefaultFont | ( | const QFont & | aFont | ) |
Set a new default fond.
This font will be used for plain text and otherwise unformatted html text.
| [in] | aFont | The default font to set. |
| void BpsGraphicsRichtextItem::setDirection | ( | Bps::Direction | aDirection | ) |
Set the new text direction.
Default is east.
| [in] | aDirection | The new direction to set. |
| void BpsGraphicsRichtextItem::setHtml | ( | const QString & | aText | ) |
Set new content as html code.
| [in] | aText | The new content. |
| void BpsGraphicsRichtextItem::setMargins | ( | const BpsMargins & | aMargins | ) |
Set new margins.
| [in] | aMargins | The new margins to set. |
| void BpsGraphicsRichtextItem::setPlainText | ( | const QString & | aText | ) |
Set new content as plain text.
| [in] | aText | The new content to set. |
| void BpsGraphicsRichtextItem::setResolution | ( | int | aResolution | ) |
Set the new resolution in DPI.
| [in] | aResolution | The 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.
| [in] | aRoundness | The 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.
| [in] | aWidth | The new text width (excluding margins). |
| qreal BpsGraphicsRichtextItem::textWidth | ( | ) | const |
| QString BpsGraphicsRichtextItem::toHtml | ( | ) | const |
| QString BpsGraphicsRichtextItem::toPlainText | ( | ) | const |