Contains helper methods to modify text. More...
#include <textmodifier.h>
Static Public Member Functions | |
static QString | shortenText (const QFontMetrics fontMetrics, const QString &text, int textMaxWidth) |
Shortens text to fit. | |
static QString | splitWord (const QFontMetrics fontMetrics, const QString &word, int textMaxWidth) |
Splits too long word. | |
static QString | splitLongWords (const QFontMetrics fontMetrics, const QString &text, int textMaxWidth) |
Splits long words from text. |
Contains helper methods to modify text.
QString TextModifier::shortenText | ( | const QFontMetrics | fontMetrics, | |
const QString & | text, | |||
int | textMaxWidth | |||
) | [static] |
Shortens text to fit.
Text shortening is defined by text maximum width.
fontMetrics | font metrics to use | |
text | text to shorten | |
textMaxWidth | maximum width for text |
QString TextModifier::splitLongWords | ( | const QFontMetrics | fontMetrics, | |
const QString & | text, | |||
int | textMaxWidth | |||
) | [static] |
Splits long words from text.
Splits long words to several by adding extra spaces
fontMetrics | font metrics to use | |
text | text to be splitted | |
textMaxWidth | maximum width for word |
QString TextModifier::splitWord | ( | const QFontMetrics | fontMetrics, | |
const QString & | word, | |||
int | textMaxWidth | |||
) | [static] |
Splits too long word.
Splits long word to several by adding extra spaces
fontMetrics | font metrics to use | |
word | long word to be splitted | |
textMaxWidth | maximum width for word |