8 class TextModifier : public QObject
12 TextModifier(QObject *parent = 0);
15 * @brief Shortens text to fit.
17 * Text shortening is defined by text maximum width.
19 * @param fontMetrics font metrics to use
20 * @param text text to shorten
21 * @param textMaxWidth maximum width for text
23 static QString shortenText(const QFontMetrics fontMetrics, const QString &text,
27 * @brief Splits too long word.
29 * Splits long word to several by adding extra spaces
31 * @param fontMetrics font metrics to use
32 * @param word long word to be splitted
33 * @param textMaxWidth maximum width for word
34 * @returns splitted word
36 static QString splitWord(const QFontMetrics fontMetrics, const QString &word, int textMaxWidth);
39 * @brief Splits long words from text.
41 * Splits long words to several by adding extra spaces
43 * @param fontMetrics font metrics to use
44 * @param text text to be splitted
45 * @param textMaxWidth maximum width for word
46 * @returns text with long words splitted
48 static QString splitLongWords(const QFontMetrics fontMetrics, const QString &text,
52 #endif // TEXTMODIFIER_H