10#include <kguiaddons_export.h>
12#include <QSharedDataPointer>
13#include <qnamespace.h>
19class KWordWrapPrivate;
51 Truncate = 0x20000000,
65 static KWordWrap formatText(QFontMetrics &fm,
const QRect &r,
int flags,
const QString &str,
int len = -1);
100 void drawText(QPainter *painter,
int x,
int y,
int flags = Qt::AlignLeft)
const;
141 KGUIADDONS_NO_EXPORT
explicit KWordWrap(
const QRect &r);
143 QExplicitlySharedDataPointer<KWordWrapPrivate> d;
Word-wrap algorithm that takes into account beautifulness ;)
Definition kwordwrap.h:43
QRect boundingRect() const
KWordWrap & operator=(const KWordWrap &other)
Assignment operator.
static void drawFadeoutText(QPainter *p, int x, int y, int maxW, const QString &t)
Draws the string t at the given coordinates, if it does not fit into maxW the text will be faded out.
static void drawTruncateText(QPainter *p, int x, int y, int maxW, const QString &t)
Draws the string t at the given coordinates, if it does not fit into maxW the text will be truncated.
KWordWrap(const KWordWrap &other)
Copy constructor.
QString truncatedString(bool dots=true) const
static KWordWrap formatText(QFontMetrics &fm, const QRect &r, int flags, const QString &str, int len=-1)
Main method for wrapping text.
void drawText(QPainter *painter, int x, int y, int flags=Qt::AlignLeft) const
Draw the text that has been previously wrapped, at position x,y.
QString wrappedString() const