KDEUI
kwordwrap.cpp
Go to the documentation of this file.
40 KWordWrap* KWordWrap::formatText( QFontMetrics &fm, const QRect & r, int /*flags*/, const QString & str, int len )
46 //kDebug() << "KWordWrap::formatText " << str << " r=" << r.x() << "," << r.y() << " " << r.width() << "x" << r.height();
97 if (i == len - 2 && x + ww + fm.charWidth(inputString, i+1) > w) // don't leave the last char alone
141 //kDebug() << "KWordWrap::formatText boundingRect:" << r.x() << "," << r.y() << " " << textwidth << "x" << y;
246 //kDebug() << "KWordWrap::drawText text=" << wrappedString() << " x=" << textX << " y=" << textY;
int ascent() const
const QBrush & background() const
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...
Definition: kwordwrap.cpp:238
QString truncatedString(bool dots=true) const
Definition: kwordwrap.cpp:174
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...
Definition: kwordwrap.cpp:191
int height() const
QString & remove(int position, int n)
const QColor & color() const
QColor color() const
bool isRightToLeft() const
QRect boundingRect(QChar ch) const
bool isSpace() const
int red() const
void setPen(const QColor &color)
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags) const
void drawText(const QPointF &position, const QString &text)
bool isPunct() const
int charWidth(const QString &text, int pos) const
int green() const
int width(const QString &text, int len) const
int blue() const
int width() const
QFontMetrics fontMetrics() const
const QChar at(int position) const
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.
Definition: kwordwrap.cpp:244
int height() const
int length() const
QString left(int n) const
Definition: kwordwrap.h:56
Definition: kwordwrap.h:56
static KWordWrap * formatText(QFontMetrics &fm, const QRect &r, int flags, const QString &str, int len=-1)
Main method for wrapping text.
Definition: kwordwrap.cpp:40
const QPen & pen() const
bool isSymbol() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.