Qt 4.8
Public Functions | Public Variables | List of all members
QTextItemInt Class Reference

Internal QTextItem. More...

#include <qtextengine_p.h>

Inheritance diagram for QTextItemInt:
QTextItem

Public Functions

void initWithScriptItem (const QScriptItem &si)
 
QTextItemInt midItem (QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const
 
 QTextItemInt ()
 
 QTextItemInt (const QScriptItem &si, QFont *font, const QTextCharFormat &format=QTextCharFormat())
 
 QTextItemInt (const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe, const QTextCharFormat &format=QTextCharFormat())
 
- Public Functions inherited from QTextItem
qreal ascent () const
 Corresponds to the ascent of the piece of text that is drawn. More...
 
qreal descent () const
 Corresponds to the descent of the piece of text that is drawn. More...
 
QFont font () const
 Returns the font that should be used to draw the text. More...
 
RenderFlags renderFlags () const
 Returns the render flags used. More...
 
QString text () const
 Returns the text that should be drawn. More...
 
qreal width () const
 Specifies the total width of the text to be drawn. More...
 

Public Variables

QFixed ascent
 
const QTextCharFormat charFormat
 
const QCharchars
 
QFixed descent
 
const QFontf
 
RenderFlags flags
 
QFontEnginefontEngine
 
QGlyphLayout glyphs
 
bool justified
 
const unsigned short * logClusters
 
int num_chars
 
QTextCharFormat::UnderlineStyle underlineStyle
 
QFixed width
 

Additional Inherited Members

- Public Types inherited from QTextItem
enum  RenderFlag {
  RightToLeft = 0x1, Overline = 0x10, Underline = 0x20, StrikeOut = 0x40,
  Dummy = 0xffffffff
}
 

Detailed Description

Internal QTextItem.

Definition at line 307 of file qtextengine_p.h.

Constructors and Destructors

◆ QTextItemInt() [1/3]

QTextItemInt::QTextItemInt ( )
inline

Definition at line 310 of file qtextengine_p.h.

312  logClusters(0), f(0), fontEngine(0)
313  {}
QFontEngine * fontEngine
const QChar * chars
const unsigned short * logClusters
QTextCharFormat::UnderlineStyle underlineStyle
const QFont * f

◆ QTextItemInt() [2/3]

QTextItemInt::QTextItemInt ( const QScriptItem si,
QFont font,
const QTextCharFormat format = QTextCharFormat() 
)

Definition at line 3086 of file qtextengine.cpp.

3088  num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0)
3089 {
3090  f = font;
3093 
3094  initWithScriptItem(si);
3095 }
QFontEngine * fontEngine
const QChar * chars
const unsigned short * logClusters
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QFontEngine * engineForScript(int script) const
Definition: qfont.cpp:294
unsigned short script
QTextCharFormat::UnderlineStyle underlineStyle
QExplicitlySharedDataPointer< QFontPrivate > d
Definition: qfont.h:343
const QTextCharFormat charFormat
void initWithScriptItem(const QScriptItem &si)
const QFont * f
QFont font() const
Returns the font that should be used to draw the text.
QScriptAnalysis analysis

◆ QTextItemInt() [3/3]

QTextItemInt::QTextItemInt ( const QGlyphLayout g,
QFont font,
const QChar chars,
int  numChars,
QFontEngine fe,
const QTextCharFormat format = QTextCharFormat() 
)

Definition at line 3097 of file qtextengine.cpp.

3099  num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
3100 {
3101 }
QFontEngine * fontEngine
const QChar * chars
RenderFlags flags
const unsigned short * logClusters
QGlyphLayout glyphs
QTextCharFormat::UnderlineStyle underlineStyle
const QTextCharFormat charFormat
const QFont * f

Functions

◆ initWithScriptItem()

void QTextItemInt::initWithScriptItem ( const QScriptItem si)

Definition at line 3104 of file qtextengine.cpp.

Referenced by QTextItemInt().

3105 {
3106  // explicitly initialize flags so that initFontAttributes can be called
3107  // multiple times on the same TextItem
3108  flags = 0;
3109  if (si.analysis.bidiLevel %2)
3111  ascent = si.ascent;
3112  descent = si.descent;
3113 
3117  || f->d->underline) {
3119  }
3120 
3121  // compat
3124 
3125  if (f->d->overline || charFormat.fontOverline())
3127  if (f->d->strikeOut || charFormat.fontStrikeOut())
3129 }
bool fontStrikeOut() const
Returns true if the text format&#39;s font is struck out (has a horizontal line drawn through it); otherw...
Definition: qtextformat.h:443
RenderFlags flags
uint overline
Definition: qfont_p.h:189
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
uint underline
Definition: qfont_p.h:188
UnderlineStyle underlineStyle() const
Returns the style of underlining the text.
Definition: qtextformat.h:481
bool fontOverline() const
Returns true if the text format&#39;s font is overlined; otherwise returns false.
Definition: qtextformat.h:438
unsigned short bidiLevel
qreal ascent() const
Corresponds to the ascent of the piece of text that is drawn.
qreal descent() const
Corresponds to the descent of the piece of text that is drawn.
QFixed descent
QTextCharFormat::UnderlineStyle underlineStyle
QExplicitlySharedDataPointer< QFontPrivate > d
Definition: qfont.h:343
bool boolProperty(int propertyId) const
Returns the value of the property specified by propertyId.
const QTextCharFormat charFormat
const QFont * f
uint strikeOut
Definition: qfont_p.h:190
QScriptAnalysis analysis

◆ midItem()

QTextItemInt QTextItemInt::midItem ( QFontEngine fontEngine,
int  firstGlyphIndex,
int  numGlyphs 
) const

copy the structure items, adjusting the glyphs arrays to the right subarrays. the width of the returned QTextItemInt is not adjusted, for speed reasons

Definition at line 3131 of file qtextengine.cpp.

Referenced by QPainter::drawTextItem().

3132 {
3133  QTextItemInt ti = *this;
3134  const int end = firstGlyphIndex + numGlyphs;
3135  ti.glyphs = glyphs.mid(firstGlyphIndex, numGlyphs);
3136  ti.fontEngine = fontEngine;
3137 
3138  if (logClusters && chars) {
3139  const int logClusterOffset = logClusters[0];
3140  while (logClusters[ti.chars - chars] - logClusterOffset < firstGlyphIndex)
3141  ++ti.chars;
3142 
3143  ti.logClusters += (ti.chars - chars);
3144 
3145  ti.num_chars = 0;
3146  int char_start = ti.chars - chars;
3147  while (char_start + ti.num_chars < num_chars && ti.logClusters[ti.num_chars] - logClusterOffset < end)
3148  ++ti.num_chars;
3149  }
3150  return ti;
3151 }
QFontEngine * fontEngine
const QChar * chars
const unsigned short * logClusters
QGlyphLayout mid(int position, int n=-1) const
QGlyphLayout glyphs
Internal QTextItem.
static const KeyPair *const end

Properties

◆ ascent

QFixed QTextItemInt::ascent

◆ charFormat

const QTextCharFormat QTextItemInt::charFormat

Definition at line 330 of file qtextengine_p.h.

Referenced by QPdfEnginePrivate::drawTextItem(), and initWithScriptItem().

◆ chars

const QChar* QTextItemInt::chars

◆ descent

QFixed QTextItemInt::descent

◆ f

const QFont* QTextItemInt::f

◆ flags

RenderFlags QTextItemInt::flags

◆ fontEngine

QFontEngine* QTextItemInt::fontEngine

◆ glyphs

QGlyphLayout QTextItemInt::glyphs

◆ justified

bool QTextItemInt::justified

◆ logClusters

const unsigned short* QTextItemInt::logClusters

◆ num_chars

int QTextItemInt::num_chars

◆ underlineStyle

QTextCharFormat::UnderlineStyle QTextItemInt::underlineStyle

Definition at line 329 of file qtextengine_p.h.

Referenced by drawMenuText(), and initWithScriptItem().

◆ width

QFixed QTextItemInt::width

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