Qt 4.8
Classes | Functions
qpaintbuffer.cpp File Reference
#include <qmath.h>
#include <private/qpainterpath_p.h>
#include <private/qpaintbuffer_p.h>
#include <private/qfontengine_p.h>
#include <private/qemulationpaintengine_p.h>
#include <private/qimage_p.h>
#include <qstatictext.h>
#include <private/qstatictext_p.h>
#include <private/qrawfont_p.h>
#include <QDebug>

Go to the source code of this file.

Classes

class  QFakeDevice
 
struct  QPaintBufferCacheEntry
 
struct  QPaintBufferCacheEntryV2
 
struct  QPaintBufferCacheEntryV2::Flags
 
class  QPaintBufferEnginePrivate
 

Functions

QDataStreamoperator<< (QDataStream &stream, const QPaintBufferCommand &command)
 
QDataStreamoperator<< (QDataStream &stream, const QPaintBufferCacheEntry &entry)
 
QDataStreamoperator<< (QDataStream &stream, const QPaintBufferCacheEntryV2 &entry)
 
QDataStreamoperator<< (QDataStream &stream, const QPaintBuffer &buffer)
 
QDataStreamoperator>> (QDataStream &stream, QPaintBufferCommand &command)
 
QDataStreamoperator>> (QDataStream &stream, QPaintBufferCacheEntry &entry)
 
QDataStreamoperator>> (QDataStream &stream, QPaintBufferCacheEntryV2 &entry)
 
QDataStreamoperator>> (QDataStream &stream, QPaintBuffer &buffer)
 
static QImage qpaintbuffer_storable_image (const QImage &src)
 
static int qRegisterPaintBufferMetaTypes ()
 
void qt_format_text (const QFont &font, const QRectF &_r, int tf, const QTextOption *option, const QString &str, QRectF *brect, int tabstops, int *tabarray, int tabarraylen, QPainter *painter)
 

Function Documentation

◆ operator<<() [1/4]

QDataStream& operator<< ( QDataStream stream,
const QPaintBufferCommand command 
)

Definition at line 2100 of file qpaintbuffer.cpp.

2101 {
2102  quint32 id = command.id;
2103  quint32 size = command.size;
2104  stream << id << size;
2105  stream << command.offset << command.offset2 << command.extra;
2106  return stream;
2107 }
static FILE * stream
unsigned int quint32
Definition: qglobal.h:938

◆ operator<<() [2/4]

QDataStream& operator<< ( QDataStream stream,
const QPaintBufferCacheEntry entry 
)

Definition at line 2149 of file qpaintbuffer.cpp.

2150 {
2151  return stream << entry.type << entry.cacheKey;
2152 }

◆ operator<<() [3/4]

QDataStream& operator<< ( QDataStream stream,
const QPaintBufferCacheEntryV2 entry 
)

Definition at line 2159 of file qpaintbuffer.cpp.

2160 {
2161  return stream << entry.bits;
2162 }

◆ operator<<() [4/4]

QDataStream& operator<< ( QDataStream stream,
const QPaintBuffer buffer 
)

Definition at line 2181 of file qpaintbuffer.cpp.

2182 {
2183  QHash<qint64, uint> pixmapKeys;
2184  QHash<qint64, uint> imageKeys;
2185 
2186  QHash<qint64, QPixmap> pixmaps;
2187  QHash<qint64, QImage> images;
2188 
2189  QVector<QVariant> variants = buffer.d_ptr->variants;
2190  for (int i = 0; i < variants.size(); ++i) {
2191  const QVariant &v = variants.at(i);
2192  if (v.type() == QVariant::Image) {
2193  const QImage image(v.value<QImage>());
2194 
2197 
2198  QHash<qint64, uint>::iterator it = imageKeys.find(image.cacheKey());
2199  if (it != imageKeys.end()) {
2200  entry.flags.key = *it;
2201  } else {
2202  imageKeys[image.cacheKey()] = entry.flags.key = images.size();
2203  images[images.size()] = image;
2204  }
2205 
2206  variants[i] = QVariant::fromValue(entry);
2207  } else if (v.type() == QVariant::Pixmap) {
2208  const QPixmap pixmap(v.value<QPixmap>());
2209 
2212 
2213  QHash<qint64, uint>::iterator it = pixmapKeys.find(pixmap.cacheKey());
2214  if (it != pixmapKeys.end()) {
2215  entry.flags.key = *it;
2216  } else {
2217  pixmapKeys[pixmap.cacheKey()] = entry.flags.key = pixmaps.size();
2218  pixmaps[pixmaps.size()] = pixmap;
2219  }
2220 
2221  variants[i] = QVariant::fromValue(entry);
2222  }
2223  }
2224 
2225  stream << pixmaps;
2226  stream << images;
2227 
2228  stream << buffer.d_ptr->ints;
2229  stream << buffer.d_ptr->floats;
2230  stream << variants;
2231  stream << buffer.d_ptr->commands;
2232  stream << buffer.d_ptr->boundingRect;
2233  stream << buffer.d_ptr->frames;
2234 
2235  return stream;
2236 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QPaintBufferPrivate * d_ptr
#define it(className, varName)
QVector< int > ints
static FILE * stream
QVector< QPaintBufferCommand > commands
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
int size() const
Returns the number of items in the hash.
Definition: qhash.h:295
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
QVector< QVariant > variants
QVector< qreal > floats

◆ operator>>() [1/4]

QDataStream& operator>> ( QDataStream stream,
QPaintBufferCommand command 
)

Definition at line 2109 of file qpaintbuffer.cpp.

2110 {
2111  quint32 id;
2112  quint32 size;
2113  stream >> id >> size;
2114  stream >> command.offset >> command.offset2 >> command.extra;
2115  command.id = id;
2116  command.size = size;
2117  return stream;
2118 }
static FILE * stream
unsigned int quint32
Definition: qglobal.h:938

◆ operator>>() [2/4]

QDataStream& operator>> ( QDataStream stream,
QPaintBufferCacheEntry entry 
)

Definition at line 2154 of file qpaintbuffer.cpp.

2155 {
2156  return stream >> entry.type >> entry.cacheKey;
2157 }

◆ operator>>() [3/4]

QDataStream& operator>> ( QDataStream stream,
QPaintBufferCacheEntryV2 entry 
)

Definition at line 2164 of file qpaintbuffer.cpp.

2165 {
2166  return stream >> entry.bits;
2167 }

◆ operator>>() [4/4]

QDataStream& operator>> ( QDataStream stream,
QPaintBuffer buffer 
)

Definition at line 2238 of file qpaintbuffer.cpp.

2239 {
2240  QHash<qint64, QPixmap> pixmaps;
2241  QHash<qint64, QImage> images;
2242 
2243  stream >> pixmaps;
2244  stream >> images;
2245 
2246  stream >> buffer.d_ptr->ints;
2247  stream >> buffer.d_ptr->floats;
2248  stream >> buffer.d_ptr->variants;
2249  stream >> buffer.d_ptr->commands;
2250  stream >> buffer.d_ptr->boundingRect;
2251  stream >> buffer.d_ptr->frames;
2252 
2253  QVector<QVariant> &variants = buffer.d_ptr->variants;
2254  for (int i = 0; i < variants.size(); ++i) {
2255  const QVariant &v = variants.at(i);
2258  if (entry.type == QVariant::Image)
2259  variants[i] = QVariant(images.value(entry.cacheKey));
2260  else
2261  variants[i] = QVariant(pixmaps.value(entry.cacheKey));
2262  } else if (v.canConvert<QPaintBufferCacheEntryV2>()) {
2264 
2266  variants[i] = QVariant(images.value(entry.flags.key));
2268  variants[i] = QVariant(pixmaps.value(entry.flags.key));
2269  else
2270  qWarning() << "operator<<(QDataStream &stream, QPaintBuffer &buffer): unrecognized cache entry type:" << entry.flags.type;
2271  }
2272  }
2273 
2274  return stream;
2275 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QPaintBufferPrivate * d_ptr
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
QVector< int > ints
static FILE * stream
QVector< QPaintBufferCommand > commands
bool canConvert(Type t) const
Returns true if the variant&#39;s type can be cast to the requested type, t.
Definition: qvariant.cpp:2886
Q_CORE_EXPORT void qWarning(const char *,...)
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
QVector< QVariant > variants
QVector< qreal > floats

◆ qpaintbuffer_storable_image()

static QImage qpaintbuffer_storable_image ( const QImage src)
inlinestatic

Definition at line 1212 of file qpaintbuffer.cpp.

Referenced by QPaintBufferEngine::drawImage().

1213 {
1214  QImageData *d = const_cast<QImage &>(src).data_ptr();
1215  return d->own_data ? src : src.copy();
1216 }
double d
Definition: qnumeric_p.h:62
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
Definition: qimage.cpp:1410
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
uint own_data
Definition: qimage_p.h:94
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81

◆ qRegisterPaintBufferMetaTypes()

static int qRegisterPaintBufferMetaTypes ( )
static

Definition at line 2169 of file qpaintbuffer.cpp.

2170 {
2171  qRegisterMetaType<QPaintBufferCacheEntry>();
2172  qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntry>("QPaintBufferCacheEntry");
2173  qRegisterMetaType<QPaintBufferCacheEntryV2>();
2174  qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntryV2>("QPaintBufferCacheEntryV2");
2175 
2176  return 0; // something
2177 }

◆ qt_format_text()

void qt_format_text ( const QFont font,
const QRectF _r,
int  tf,
const QTextOption option,
const QString str,
QRectF brect,
int  tabstops,
int *  tabarray,
int  tabarraylen,
QPainter painter 
)

Definition at line 8458 of file qpainter.cpp.

Referenced by QPainter::boundingRect(), QPainter::drawText(), QPainterReplayer::process(), and qt_format_text().

8462 {
8463 
8464  Q_ASSERT( !((tf & ~Qt::TextDontPrint)!=0 && option!=0) ); // we either have an option or flags
8465 
8466  if (option) {
8467  tf |= option->alignment();
8468  if (option->wrapMode() != QTextOption::NoWrap)
8469  tf |= Qt::TextWordWrap;
8470 
8471  if (option->flags() & QTextOption::IncludeTrailingSpaces)
8473 
8474  if (option->tabStop() >= 0 || !option->tabArray().isEmpty())
8475  tf |= Qt::TextExpandTabs;
8476  }
8477 
8478  // we need to copy r here to protect against the case (&r == brect).
8479  QRectF r(_r);
8480 
8481  bool dontclip = (tf & Qt::TextDontClip);
8482  bool wordwrap = (tf & Qt::TextWordWrap) || (tf & Qt::TextWrapAnywhere);
8483  bool singleline = (tf & Qt::TextSingleLine);
8484  bool showmnemonic = (tf & Qt::TextShowMnemonic);
8485  bool hidemnmemonic = (tf & Qt::TextHideMnemonic);
8486 
8488  if (tf & Qt::TextForceLeftToRight)
8489  layout_direction = Qt::LeftToRight;
8490  else if (tf & Qt::TextForceRightToLeft)
8491  layout_direction = Qt::RightToLeft;
8492  else if (option)
8493  layout_direction = option->textDirection();
8494  else if (painter)
8495  layout_direction = painter->layoutDirection();
8496  else
8497  layout_direction = Qt::LeftToRight;
8498 
8499  tf = QStyle::visualAlignment(layout_direction, QFlag(tf));
8500 
8501  bool isRightToLeft = layout_direction == Qt::RightToLeft;
8502  bool expandtabs = ((tf & Qt::TextExpandTabs) &&
8503  (((tf & Qt::AlignLeft) && !isRightToLeft) ||
8504  ((tf & Qt::AlignRight) && isRightToLeft)));
8505 
8506  if (!painter)
8507  tf |= Qt::TextDontPrint;
8508 
8509  uint maxUnderlines = 0;
8510  int numUnderlines = 0;
8511  QVarLengthArray<int, 32> underlinePositions(1);
8512 
8513  QFontMetricsF fm(fnt);
8514  QString text = str;
8515  int offset = 0;
8516 start_lengthVariant:
8517  bool hasMoreLengthVariants = false;
8518  // compatible behaviour to the old implementation. Replace
8519  // tabs by spaces
8520  int old_offset = offset;
8521  for (; offset < text.length(); offset++) {
8522  QChar chr = text.at(offset);
8523  if (chr == QLatin1Char('\r') || (singleline && chr == QLatin1Char('\n'))) {
8524  text[offset] = QLatin1Char(' ');
8525  } else if (chr == QLatin1Char('\n')) {
8526  text[offset] = QChar::LineSeparator;
8527  } else if (chr == QLatin1Char('&')) {
8528  ++maxUnderlines;
8529  } else if (chr == QLatin1Char('\t')) {
8530  if (!expandtabs) {
8531  text[offset] = QLatin1Char(' ');
8532  } else if (!tabarraylen && !tabstops) {
8533  tabstops = qRound(fm.width(QLatin1Char('x'))*8);
8534  }
8535  } else if (chr == QChar(ushort(0x9c))) {
8536  // string with multiple length variants
8537  hasMoreLengthVariants = true;
8538  break;
8539  }
8540  }
8541 
8542  int length = offset - old_offset;
8543  if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) {
8544  underlinePositions.resize(maxUnderlines + 1);
8545 
8546  QChar *cout = text.data() + old_offset;
8547  QChar *cin = cout;
8548  int l = length;
8549  while (l) {
8550  if (*cin == QLatin1Char('&')) {
8551  ++cin;
8552  --length;
8553  --l;
8554  if (!l)
8555  break;
8556  if (*cin != QLatin1Char('&') && !hidemnmemonic)
8557  underlinePositions[numUnderlines++] = cout - text.data() - old_offset;
8558  }
8559  *cout = *cin;
8560  ++cout;
8561  ++cin;
8562  --l;
8563  }
8564  }
8565 
8566  // no need to do extra work for underlines if we don't paint
8567  if (tf & Qt::TextDontPrint)
8568  numUnderlines = 0;
8569 
8570  underlinePositions[numUnderlines] = -1;
8571  qreal height = 0;
8572  qreal width = 0;
8573 
8574  QString finalText = text.mid(old_offset, length);
8575  QStackTextEngine engine(finalText, fnt);
8576  if (option) {
8577  engine.option = *option;
8578  }
8579 
8580  if (engine.option.tabStop() < 0 && tabstops > 0)
8581  engine.option.setTabStop(tabstops);
8582 
8583  if (engine.option.tabs().isEmpty() && ta) {
8584  QList<qreal> tabs;
8585  for (int i = 0; i < tabarraylen; i++)
8586  tabs.append(qreal(ta[i]));
8587  engine.option.setTabArray(tabs);
8588  }
8589 
8590  engine.option.setTextDirection(layout_direction);
8591  if (tf & Qt::AlignJustify)
8592  engine.option.setAlignment(Qt::AlignJustify);
8593  else
8594  engine.option.setAlignment(Qt::AlignLeft); // do not do alignment twice
8595 
8596  if (!option && (tf & Qt::TextWrapAnywhere))
8597  engine.option.setWrapMode(QTextOption::WrapAnywhere);
8598 
8599  if (tf & Qt::TextJustificationForced)
8600  engine.forceJustification = true;
8601  QTextLayout textLayout(&engine);
8602  textLayout.setCacheEnabled(true);
8603  textLayout.engine()->underlinePositions = underlinePositions.data();
8604 
8605  if (finalText.isEmpty()) {
8606  height = fm.height();
8607  width = 0;
8608  tf |= Qt::TextDontPrint;
8609  } else {
8610  qreal lineWidth = 0x01000000;
8611  if (wordwrap || (tf & Qt::TextJustificationForced))
8612  lineWidth = qMax<qreal>(0, r.width());
8613  if(!wordwrap)
8615  textLayout.engine()->ignoreBidi = bool(tf & Qt::TextDontPrint);
8616  textLayout.beginLayout();
8617 
8618  qreal leading = fm.leading();
8619  height = -leading;
8620 
8621  while (1) {
8622  QTextLine l = textLayout.createLine();
8623  if (!l.isValid())
8624  break;
8625 
8626  l.setLineWidth(lineWidth);
8627  height += leading;
8628  l.setPosition(QPointF(0., height));
8629  height += l.height();
8630  width = qMax(width, l.naturalTextWidth());
8631  if (!dontclip && !brect && height >= r.height())
8632  break;
8633  }
8634  textLayout.endLayout();
8635  }
8636 
8637  qreal yoff = 0;
8638  qreal xoff = 0;
8639  if (tf & Qt::AlignBottom) {
8640  yoff = r.height() - height;
8641  } else if (tf & Qt::AlignVCenter) {
8642  yoff = (r.height() - height)/2;
8643  if (painter) {
8645  if (type <= QTransform::TxScale) {
8646  // do the rounding manually to work around inconsistencies
8647  // in the paint engines when drawing on floating point offsets
8648  const qreal scale = painter->transform().m22();
8649  if (scale != 0)
8650  yoff = -qRound(-yoff * scale) / scale;
8651  }
8652  }
8653  }
8654  if (tf & Qt::AlignRight) {
8655  xoff = r.width() - width;
8656  } else if (tf & Qt::AlignHCenter) {
8657  xoff = (r.width() - width)/2;
8658  if (painter) {
8659  QTransform::TransformationType type = painter->transform().type();
8660  if (type <= QTransform::TxScale) {
8661  // do the rounding manually to work around inconsistencies
8662  // in the paint engines when drawing on floating point offsets
8663  const qreal scale = painter->transform().m11();
8664  if (scale != 0)
8665  xoff = qRound(xoff * scale) / scale;
8666  }
8667  }
8668  }
8669  QRectF bounds = QRectF(r.x() + xoff, r.y() + yoff, width, height);
8670 
8671  if (hasMoreLengthVariants && !(tf & Qt::TextLongestVariant) && !r.contains(bounds)) {
8672  offset++;
8673  goto start_lengthVariant;
8674  }
8675  if (brect)
8676  *brect = bounds;
8677 
8678  if (!(tf & Qt::TextDontPrint)) {
8679  bool restore = false;
8680  if (!dontclip && !r.contains(bounds)) {
8681  restore = true;
8682  painter->save();
8683  painter->setClipRect(r, Qt::IntersectClip);
8684  }
8685 
8686  for (int i = 0; i < textLayout.lineCount(); i++) {
8687  QTextLine line = textLayout.lineAt(i);
8688 
8689  qreal advance = line.horizontalAdvance();
8690  xoff = 0;
8691  if (tf & Qt::AlignRight) {
8692  QTextEngine *eng = textLayout.engine();
8693  xoff = r.width() - advance -
8694  eng->leadingSpaceWidth(eng->lines[line.lineNumber()]).toReal();
8695  }
8696  else if (tf & Qt::AlignHCenter)
8697  xoff = (r.width() - advance) / 2;
8698 
8699  line.draw(painter, QPointF(r.x() + xoff, r.y() + yoff));
8700  }
8701 
8702  if (restore) {
8703  painter->restore();
8704  }
8705  }
8706 }
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
qreal horizontalAdvance() const
Returns the horizontal advance of the text.
void setPosition(const QPointF &pos)
Moves the line to position pos.
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
The QFlag class is a helper data type for QFlags.
Definition: qglobal.h:2289
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
Definition: qpainter.cpp:2801
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QTextLine class represents a line of text inside a QTextLayout.
Definition: qtextlayout.h:197
void restore()
Restores the current painter state (pops a saved state off the stack).
Definition: qpainter.cpp:1620
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
Flags flags() const
Returns the flags associated with the option.
Definition: qtextoption.h:121
void setLineWidth(qreal width)
Lays out the line with the given width.
The QString class provides a Unicode character string.
Definition: qstring.h:83
QList< qreal > tabArray() const
Returns a list of tab positions defined for the text layout.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
TransformationType type() const
Returns the transformation type of this matrix.
bool isValid() const
Returns true if this text line is valid; otherwise returns false.
Definition: qtextlayout.h:201
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
QChar * data()
Returns a pointer to the data stored in the QString.
Definition: qstring.h:710
qreal tabStop() const
Returns the distance in device units between tab stops.
Definition: qtextoption.h:124
void save()
Saves the current painter state (pushes the state onto a stack).
Definition: qpainter.cpp:1590
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
TransformationType
Definition: qtransform.h:68
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static Qt::LayoutDirection layout_direction
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
int lineNumber() const
Returns the position of the line in the text engine.
Definition: qtextlayout.h:243
LayoutDirection
Definition: qnamespace.h:1580
unsigned int uint
Definition: qglobal.h:996
QScriptLineArray lines
Qt::LayoutDirection layoutDirection() const
Returns the layout direction used by the painter when drawing text.
Definition: qpainter.cpp:8729
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
The QTextLayout class is used to lay out and render text.
Definition: qtextlayout.h:105
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
Definition: qstyle.cpp:2149
unsigned short ushort
Definition: qglobal.h:995
Qt::LayoutDirection textDirection() const
Returns the direction of the text layout defined by the option.
Definition: qtextoption.h:100
qreal naturalTextWidth() const
Returns the width of the line that is occupied by text.
WrapMode wrapMode() const
Returns the text wrap mode defined by the option.
Definition: qtextoption.h:110
QFactoryLoader * l
Qt::Alignment alignment() const
Returns the text alignment defined by the option.
Definition: qtextoption.h:97
The QFontMetricsF class provides font metrics information.
Definition: qfontmetrics.h:145
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection=0) const
Draws a line on the given painter at the specified position.
qreal height() const
Returns the line&#39;s height.
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
void setTabStop(qreal tabStop)
Sets the default distance in device units between tab stops to the value specified by tabStop...
Definition: qtextoption.h:154
QFixed leadingSpaceWidth(const QScriptLine &line)
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237
#define text
Definition: qobjectdefs.h:80
static qreal toReal(Register *reg, int type, bool *ok=0)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QFixed width(int charFrom, int numChars) const