Qt 4.8
Public Functions | Public Variables | List of all members
QScriptLine Struct Reference

#include <qtextengine_p.h>

Public Functions

QFixed base () const
 
QFixed height () const
 
void operator+= (const QScriptLine &other)
 
 QScriptLine ()
 
void setDefaultHeight (QTextEngine *eng)
 

Public Variables

QFixed ascent
 
QFixed descent
 
int from
 
uint gridfitted: 1
 
uint hasTrailingSpaces: 1
 
uint justified: 1
 
QFixed leading
 
uint leadingIncluded: 1
 
signed int length: 28
 
QFixed textAdvance
 
QFixed textWidth
 
unsigned short trailingSpaces
 
QFixed width
 
QFixed x
 
QFixed y
 

Detailed Description

Definition at line 375 of file qtextengine_p.h.

Constructors and Destructors

◆ QScriptLine()

QScriptLine::QScriptLine ( )
inline

Definition at line 378 of file qtextengine_p.h.

379  : from(0), trailingSpaces(0), length(0),
380  justified(0), gridfitted(0),
unsigned short trailingSpaces
uint leadingIncluded
uint hasTrailingSpaces
signed int length

Functions

◆ base()

QFixed QScriptLine::base ( ) const
inline

Definition at line 399 of file qtextengine_p.h.

Referenced by QTextLine::draw(), QTextLayout::drawCursor(), and QTextLine::glyphs().

399  { return ascent
400  + (leadingIncluded ? qMax(QFixed(),leading) : QFixed()); }
QFixed leading
uint leadingIncluded
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ height()

QFixed QScriptLine::height ( ) const
inline

Definition at line 397 of file qtextengine_p.h.

Referenced by addSelectedRegionsToPath(), QTextLayout::boundingRect(), QTextLayout::draw(), QTextLine::draw(), QTextLine::naturalTextRect(), and QTextLine::rect().

397  { return (ascent + descent).ceil() + 1
398  + (leadingIncluded? qMax(QFixed(),leading) : QFixed()); }
QFixed leading
uint leadingIncluded
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
QFixed descent

◆ operator+=()

void QScriptLine::operator+= ( const QScriptLine other)
inline

Definition at line 407 of file qtextengine_p.h.

408 {
409  leading= qMax(leading + ascent, other.leading + other.ascent) - qMax(ascent, other.ascent);
410  descent = qMax(descent, other.descent);
411  ascent = qMax(ascent, other.ascent);
412  textWidth += other.textWidth;
413  length += other.length;
414 }
QFixed leading
QFixed textWidth
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
QFixed descent
signed int length

◆ setDefaultHeight()

void QScriptLine::setDefaultHeight ( QTextEngine eng)

Definition at line 2182 of file qtextengine.cpp.

Referenced by QTextLine::layout_helper().

2183 {
2184  QFont f;
2185  QFontEngine *e;
2186 
2187  if (eng->block.docHandle() && eng->block.docHandle()->layout()) {
2188  f = eng->block.charFormat().font();
2189  // Make sure we get the right dpi on printers
2190  QPaintDevice *pdev = eng->block.docHandle()->layout()->paintDevice();
2191  if (pdev)
2192  f = QFont(f, pdev);
2194  } else {
2196  }
2197 
2198  QFixed other_ascent = e->ascent();
2199  QFixed other_descent = e->descent();
2200  QFixed other_leading = e->leading();
2201  leading = qMax(leading + ascent, other_leading + other_ascent) - qMax(ascent, other_ascent);
2202  ascent = qMax(ascent, other_ascent);
2203  descent = qMax(descent, other_descent);
2204 }
QFont font() const
Returns the font for this character format.
QFixed leading
QAbstractTextDocumentLayout * layout() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual QFixed ascent() const =0
virtual QFixed descent() const =0
QTextCharFormat charFormat() const
Returns the QTextCharFormat that describes the block&#39;s character format.
QFontEngine * engineForScript(int script) const
Definition: qfont.cpp:294
QTextBlock block
QFixed descent
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
QExplicitlySharedDataPointer< QFontPrivate > d
Definition: qfont.h:343
QPaintDevice * paintDevice() const
Returns the paint device used to render the document&#39;s layout.
QTextDocumentPrivate * docHandle() const
Definition: qtextobject.h:283
virtual QFixed leading() const =0

Properties

◆ ascent

QFixed QScriptLine::ascent

Definition at line 383 of file qtextengine_p.h.

Referenced by QTextLine::layout_helper(), and operator+=().

◆ descent

QFixed QScriptLine::descent

Definition at line 382 of file qtextengine_p.h.

Referenced by QTextLayout::drawCursor(), QTextLine::layout_helper(), and operator+=().

◆ from

int QScriptLine::from

◆ gridfitted

uint QScriptLine::gridfitted
mutable

◆ hasTrailingSpaces

uint QScriptLine::hasTrailingSpaces

Definition at line 395 of file qtextengine_p.h.

Referenced by QTextLine::layout_helper(), and QTextEngine::leadingSpaceWidth().

◆ justified

uint QScriptLine::justified
mutable

◆ leading

QFixed QScriptLine::leading

Definition at line 384 of file qtextengine_p.h.

Referenced by operator+=().

◆ leadingIncluded

uint QScriptLine::leadingIncluded

Definition at line 396 of file qtextengine_p.h.

◆ length

signed int QScriptLine::length

◆ textAdvance

QFixed QScriptLine::textAdvance

Definition at line 389 of file qtextengine_p.h.

Referenced by QTextEngine::alignLine(), and QTextLine::layout_helper().

◆ textWidth

QFixed QScriptLine::textWidth

◆ trailingSpaces

unsigned short QScriptLine::trailingSpaces

◆ width

QFixed QScriptLine::width

◆ x

QFixed QScriptLine::x

◆ y

QFixed QScriptLine::y

The documentation for this struct was generated from the following files: