Qt 4.8
Public Functions | Static Public Functions | Private Functions | Properties | List of all members
QFixed Struct Reference

#include <qfixed_p.h>

Public Functions

QFixed ceil () const
 
QFixed floor () const
 
bool operator! () const
 
bool operator!= (const QFixed &other) const
 
QFixed operator* (int i) const
 
QFixed operator* (uint i) const
 
QFixed operator* (const QFixed &o) const
 
QFixedoperator*= (int i)
 
QFixedoperator*= (uint i)
 
QFixedoperator*= (const QFixed &o)
 
QFixed operator+ (int i) const
 
QFixed operator+ (uint i) const
 
QFixed operator+ (const QFixed &other) const
 
QFixedoperator+= (int i)
 
QFixedoperator+= (uint i)
 
QFixedoperator+= (const QFixed &other)
 
QFixed operator- (int i) const
 
QFixed operator- (uint i) const
 
QFixed operator- (const QFixed &other) const
 
QFixed operator- () const
 
QFixedoperator-= (int i)
 
QFixedoperator-= (uint i)
 
QFixedoperator-= (const QFixed &other)
 
QFixed operator/ (int d) const
 
QFixed operator/ (QFixed b) const
 
QFixedoperator/= (int x)
 
QFixedoperator/= (const QFixed &o)
 
bool operator< (const QFixed &other) const
 
bool operator<= (const QFixed &other) const
 
QFixedoperator= (int i)
 
QFixedoperator= (long i)
 
bool operator== (const QFixed &other) const
 
bool operator> (const QFixed &other) const
 
bool operator>= (const QFixed &other) const
 
QFixed operator>> (int d) const
 
 QFixed ()
 
 QFixed (int i)
 
 QFixed (long i)
 
QFixed round () const
 
void setValue (int value)
 
int toInt () const
 
qreal toReal () const
 
int truncate () const
 
int value () const
 

Static Public Functions

static QFixed fromFixed (int fixed)
 
static QFixed fromReal (qreal r)
 

Private Functions

QFixed operator* (qreal d) const
 
QFixedoperator*= (qreal d)
 
QFixed operator+ (qreal i) const
 
QFixedoperator+= (qreal i)
 
QFixed operator- (qreal i) const
 
QFixedoperator-= (qreal i)
 
QFixed operator/ (qreal d) const
 
QFixedoperator/= (qreal r)
 
QFixedoperator= (qreal i)
 
 QFixed (qreal i)
 

Properties

int val
 

Detailed Description

Definition at line 62 of file qfixed_p.h.

Constructors and Destructors

◆ QFixed() [1/4]

QFixed::QFixed ( )
inline

Definition at line 64 of file qfixed_p.h.

64 : val(0) {}
int val
Definition: qfixed_p.h:154

◆ QFixed() [2/4]

QFixed::QFixed ( int  i)
inline

Definition at line 65 of file qfixed_p.h.

65 : val(i<<6) {}
int val
Definition: qfixed_p.h:154

◆ QFixed() [3/4]

QFixed::QFixed ( long  i)
inline

Definition at line 66 of file qfixed_p.h.

66 : val(i<<6) {}
int val
Definition: qfixed_p.h:154

◆ QFixed() [4/4]

QFixed::QFixed ( qreal  i)
inlineprivate

Definition at line 144 of file qfixed_p.h.

144 : val((int)(i*qreal(64))) {}
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

Functions

◆ ceil()

QFixed QFixed::ceil ( ) const
inline

Definition at line 82 of file qfixed_p.h.

Referenced by QScriptLine::height(), QFontEngineXLFD::leading(), QFontEngineBox::leading(), and QTextureGlyphCache::populate().

82 { QFixed f; f.val = (val+63) & -64; return f; }
int val
Definition: qfixed_p.h:154

◆ floor()

QFixed QFixed::floor ( ) const
inline

◆ fromFixed()

static QFixed QFixed::fromFixed ( int  fixed)
inlinestatic

◆ fromReal()

static QFixed QFixed::fromReal ( qreal  r)
inlinestatic

Definition at line 70 of file qfixed_p.h.

Referenced by QFontEngine::addBitmapFontToPath(), QFontEngine::addGlyphsToPath(), QFontEngineQPA::ascent(), QFontEngineQPF::ascent(), QTextDocumentLayoutPrivate::blockIndent(), QFontEngineMac::boundingBox(), QFontEngineWin::boundingBox(), QTextureGlyphCache::calculateSubPixelPositionCount(), QTextEngine::calculateTabWidth(), QProxyFontEngine::canRender(), QFontEngineQPA::descent(), QFontEngineQPF::descent(), QDeclarativeTextLayout::draw(), QTextDocumentLayout::draw(), QTextLayout::draw(), QFontEngineQPF::draw(), QTextLine::draw(), QFontEngineQPF1::draw(), QRasterPaintEngine::drawCachedGlyphs(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawFrame(), QX11PaintEngine::drawFreetype(), QPainter::drawStaticText(), QPainter::drawText(), QX11PaintEngine::drawXLFD(), QFontMetricsF::elidedText(), QTextDocumentLayout::ensureLayouted(), flowPosition(), QFixedPoint::fromPointF(), QFixedSize::fromSizeF(), QFontEngine::getGlyphPositions(), getLineHeightParams(), QFontEngineMac::getUnscaledGlyph(), QTextDocumentLayout::hitTest(), QTextLine::layout_helper(), QTextDocumentLayoutPrivate::layoutBlock(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutFlow(), QTextDocumentLayoutPrivate::layoutFrame(), QTextDocumentLayoutPrivate::layoutTable(), QFontEngineXLFD::leading(), QFontEngineQPA::leading(), QFontEngineQPF::leading(), QFontEngineBox::leading(), QFontEngineQPA::lineThickness(), QFontEngineQPF::lineThickness(), QTextTableData::paddingProperty(), QTextDocumentLayoutPrivate::positionFloat(), QFontEngineMac::QFontEngineMac(), QTextLineItemIterator::QTextLineItemIterator(), QFontEngineMac::recalcAdvances(), QTextInlineObject::setAscent(), QTextInlineObject::setDescent(), QFont::setLetterSpacing(), QTextLine::setLineWidth(), QTextLine::setNumColumns(), QTextLine::setPosition(), QTextInlineObject::setWidth(), QFont::setWordSpacing(), QTextureGlyphCache::subPixelPositionForX(), QFontEngineFT::subPixelPositionForX(), glyph_metrics_t::transformed(), QFontEngineQPA::underlinePosition(), QFontEngineQPF::underlinePosition(), QPAGenerator::writeHeader(), QPFGenerator::writeHeader(), and QTextLine::xToCursor().

70 { QFixed f; f.val = (int)(r*qreal(64)); return f; }
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

◆ operator!()

bool QFixed::operator! ( ) const
inline

Definition at line 104 of file qfixed_p.h.

104 { return !val; }
int val
Definition: qfixed_p.h:154

◆ operator!=()

bool QFixed::operator!= ( const QFixed other) const
inline

Definition at line 99 of file qfixed_p.h.

99 { return val != other.val; }
int val
Definition: qfixed_p.h:154

◆ operator*() [1/4]

QFixed QFixed::operator* ( int  i) const
inline

Definition at line 139 of file qfixed_p.h.

139 { QFixed f = *this; return (f *= i); }

◆ operator*() [2/4]

QFixed QFixed::operator* ( uint  i) const
inline

Definition at line 140 of file qfixed_p.h.

140 { QFixed f = *this; return (f *= i); }

◆ operator*() [3/4]

QFixed QFixed::operator* ( const QFixed o) const
inline

Definition at line 141 of file qfixed_p.h.

141 { QFixed f = *this; return (f *= o); }

◆ operator*() [4/4]

QFixed QFixed::operator* ( qreal  d) const
inlineprivate

Definition at line 153 of file qfixed_p.h.

153 { QFixed f = *this; return (f *= d); }
double d
Definition: qnumeric_p.h:62

◆ operator*=() [1/4]

QFixed& QFixed::operator*= ( int  i)
inline

Definition at line 126 of file qfixed_p.h.

126 { val *= i; return *this; }
int val
Definition: qfixed_p.h:154

◆ operator*=() [2/4]

QFixed& QFixed::operator*= ( uint  i)
inline

Definition at line 127 of file qfixed_p.h.

127 { val *= i; return *this; }
int val
Definition: qfixed_p.h:154

◆ operator*=() [3/4]

QFixed& QFixed::operator*= ( const QFixed o)
inline

Definition at line 128 of file qfixed_p.h.

128  {
129  bool neg = false;
130  qint64 a = val;
131  qint64 b = o.val;
132  if (a < 0) { a = -a; neg = true; }
133  if (b < 0) { b = -b; neg = !neg; }
134 
135  int res = (int)((a * b + 0x20L) >> 6);
136  val = neg ? -res : res;
137  return *this;
138  }
int val
Definition: qfixed_p.h:154
long ASN1_INTEGER_get ASN1_INTEGER * a
__int64 qint64
Definition: qglobal.h:942

◆ operator*=() [4/4]

QFixed& QFixed::operator*= ( qreal  d)
inlineprivate

Definition at line 152 of file qfixed_p.h.

152 { val = (int) (val*d); return *this; }
double d
Definition: qnumeric_p.h:62
int val
Definition: qfixed_p.h:154

◆ operator+() [1/4]

QFixed QFixed::operator+ ( int  i) const
inline

Definition at line 84 of file qfixed_p.h.

84 { QFixed f; f.val = (val + (i<<6)); return f; }
int val
Definition: qfixed_p.h:154

◆ operator+() [2/4]

QFixed QFixed::operator+ ( uint  i) const
inline

Definition at line 85 of file qfixed_p.h.

85 { QFixed f; f.val = (val + (i<<6)); return f; }
int val
Definition: qfixed_p.h:154

◆ operator+() [3/4]

QFixed QFixed::operator+ ( const QFixed other) const
inline

Definition at line 86 of file qfixed_p.h.

86 { QFixed f; f.val = (val + other.val); return f; }
int val
Definition: qfixed_p.h:154

◆ operator+() [4/4]

QFixed QFixed::operator+ ( qreal  i) const
inlineprivate

Definition at line 146 of file qfixed_p.h.

146 { QFixed f; f.val = (val + (int)(i*qreal(64))); return f; }
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

◆ operator+=() [1/4]

QFixed& QFixed::operator+= ( int  i)
inline

Definition at line 87 of file qfixed_p.h.

87 { val += (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator+=() [2/4]

QFixed& QFixed::operator+= ( uint  i)
inline

Definition at line 88 of file qfixed_p.h.

88 { val += (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator+=() [3/4]

QFixed& QFixed::operator+= ( const QFixed other)
inline

Definition at line 89 of file qfixed_p.h.

89 { val += other.val; return *this; }
int val
Definition: qfixed_p.h:154

◆ operator+=() [4/4]

QFixed& QFixed::operator+= ( qreal  i)
inlineprivate

Definition at line 147 of file qfixed_p.h.

147 { val += (int)(i*64); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator-() [1/5]

QFixed QFixed::operator- ( int  i) const
inline

Definition at line 90 of file qfixed_p.h.

90 { QFixed f; f.val = (val - (i<<6)); return f; }
int val
Definition: qfixed_p.h:154

◆ operator-() [2/5]

QFixed QFixed::operator- ( uint  i) const
inline

Definition at line 91 of file qfixed_p.h.

91 { QFixed f; f.val = (val - (i<<6)); return f; }
int val
Definition: qfixed_p.h:154

◆ operator-() [3/5]

QFixed QFixed::operator- ( const QFixed other) const
inline

Definition at line 92 of file qfixed_p.h.

92 { QFixed f; f.val = (val - other.val); return f; }
int val
Definition: qfixed_p.h:154

◆ operator-() [4/5]

QFixed QFixed::operator- ( ) const
inline

Definition at line 96 of file qfixed_p.h.

96 { QFixed f; f.val = -val; return f; }
int val
Definition: qfixed_p.h:154

◆ operator-() [5/5]

QFixed QFixed::operator- ( qreal  i) const
inlineprivate

Definition at line 148 of file qfixed_p.h.

148 { QFixed f; f.val = (val - (int)(i*qreal(64))); return f; }
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

◆ operator-=() [1/4]

QFixed& QFixed::operator-= ( int  i)
inline

Definition at line 93 of file qfixed_p.h.

93 { val -= (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator-=() [2/4]

QFixed& QFixed::operator-= ( uint  i)
inline

Definition at line 94 of file qfixed_p.h.

94 { val -= (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator-=() [3/4]

QFixed& QFixed::operator-= ( const QFixed other)
inline

Definition at line 95 of file qfixed_p.h.

95 { val -= other.val; return *this; }
int val
Definition: qfixed_p.h:154

◆ operator-=() [4/4]

QFixed& QFixed::operator-= ( qreal  i)
inlineprivate

Definition at line 149 of file qfixed_p.h.

149 { val -= (int)(i*64); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator/() [1/3]

QFixed QFixed::operator/ ( int  d) const
inline

Definition at line 123 of file qfixed_p.h.

123 { QFixed f; f.val = val/d; return f; }
double d
Definition: qnumeric_p.h:62
int val
Definition: qfixed_p.h:154

◆ operator/() [2/3]

QFixed QFixed::operator/ ( QFixed  b) const
inline

Definition at line 124 of file qfixed_p.h.

124 { QFixed f = *this; return (f /= b); }

◆ operator/() [3/3]

QFixed QFixed::operator/ ( qreal  d) const
inlineprivate

Definition at line 151 of file qfixed_p.h.

151 { QFixed f; f.val = (int)(val/d); return f; }
double d
Definition: qnumeric_p.h:62
int val
Definition: qfixed_p.h:154

◆ operator/=() [1/3]

QFixed& QFixed::operator/= ( int  x)
inline

Definition at line 106 of file qfixed_p.h.

106 { val /= x; return *this; }
int val
Definition: qfixed_p.h:154

◆ operator/=() [2/3]

QFixed& QFixed::operator/= ( const QFixed o)
inline

Definition at line 107 of file qfixed_p.h.

107  {
108  if (o.val == 0) {
109  val = 0x7FFFFFFFL;
110  } else {
111  bool neg = false;
112  qint64 a = val;
113  qint64 b = o.val;
114  if (a < 0) { a = -a; neg = true; }
115  if (b < 0) { b = -b; neg = !neg; }
116 
117  int res = (int)(((a << 6) + (b >> 1)) / b);
118 
119  val = (neg ? -res : res);
120  }
121  return *this;
122  }
int val
Definition: qfixed_p.h:154
long ASN1_INTEGER_get ASN1_INTEGER * a
__int64 qint64
Definition: qglobal.h:942

◆ operator/=() [3/3]

QFixed& QFixed::operator/= ( qreal  r)
inlineprivate

Definition at line 150 of file qfixed_p.h.

150 { val = (int)(val/r); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator<()

bool QFixed::operator< ( const QFixed other) const
inline

Definition at line 100 of file qfixed_p.h.

100 { return val < other.val; }
int val
Definition: qfixed_p.h:154

◆ operator<=()

bool QFixed::operator<= ( const QFixed other) const
inline

Definition at line 102 of file qfixed_p.h.

102 { return val <= other.val; }
int val
Definition: qfixed_p.h:154

◆ operator=() [1/3]

QFixed& QFixed::operator= ( int  i)
inline

Definition at line 67 of file qfixed_p.h.

67 { val = (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator=() [2/3]

QFixed& QFixed::operator= ( long  i)
inline

Definition at line 68 of file qfixed_p.h.

68 { val = (i<<6); return *this; }
int val
Definition: qfixed_p.h:154

◆ operator=() [3/3]

QFixed& QFixed::operator= ( qreal  i)
inlineprivate

Definition at line 145 of file qfixed_p.h.

145 { val = (int)(i*qreal(64)); return *this; }
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

◆ operator==()

bool QFixed::operator== ( const QFixed other) const
inline

Definition at line 98 of file qfixed_p.h.

98 { return val == other.val; }
int val
Definition: qfixed_p.h:154

◆ operator>()

bool QFixed::operator> ( const QFixed other) const
inline

Definition at line 101 of file qfixed_p.h.

101 { return val > other.val; }
int val
Definition: qfixed_p.h:154

◆ operator>=()

bool QFixed::operator>= ( const QFixed other) const
inline

Definition at line 103 of file qfixed_p.h.

103 { return val >= other.val; }
int val
Definition: qfixed_p.h:154

◆ operator>>()

QFixed QFixed::operator>> ( int  d) const
inline

Definition at line 125 of file qfixed_p.h.

125 { QFixed f = *this; f.val >>= d; return f; }
double d
Definition: qnumeric_p.h:62
int val
Definition: qfixed_p.h:154

◆ round()

QFixed QFixed::round ( ) const
inline

◆ setValue()

void QFixed::setValue ( int  value)
inline

Definition at line 74 of file qfixed_p.h.

74 { val = value; }
int value() const
Definition: qfixed_p.h:73
int val
Definition: qfixed_p.h:154

◆ toInt()

int QFixed::toInt ( ) const
inline

◆ toReal()

qreal QFixed::toReal ( ) const
inline

Definition at line 77 of file qfixed_p.h.

Referenced by QFontEngineDirectWrite::addGlyphsToPath(), QFontEngine::addGlyphsToPath(), addGlyphsToPathHelper(), QFontEngineXLFD::addOutlineToPath(), QFontEngineMulti::addOutlineToPath(), addSelectedRegionsToPath(), QPainterPath::addText(), QRawFont::advancesForGlyphIndexes(), QFontEngineDirectWrite::alphaMapBoundingBox(), QFontEngine::alphaMapForGlyph(), alphaMapFromPath(), QTextItem::ascent(), QRawFont::ascent(), QFontMetricsF::ascent(), QRawFont::averageCharWidth(), QFontMetricsF::averageCharWidth(), QFontEngineXLFD::bitmapForGlyphs(), QTextLayout::boundingRect(), QFontMetricsF::boundingRect(), QGLGlyphCache::cacheGlyphs(), QTextLine::cursorToX(), QTextItem::descent(), QRawFont::descent(), QFontMetricsF::descent(), QTextDocumentLayout::draw(), QFontEngineMac::draw(), QTextLine::draw(), QPaintEnginePrivate::drawBoxTextItem(), QVGPaintEngine::drawCachedGlyphs(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QPainterPrivate::drawGlyphs(), drawMenuText(), QTextDocumentLayoutPrivate::drawTableCell(), QPainter::drawText(), QEmulationPaintEngine::drawTextItem(), QPicturePaintEngine::drawTextItem(), QPdfEnginePrivate::drawTextItem(), QPdfBaseEnginePrivate::drawTextItem(), QPaintBufferEngine::drawTextItem(), QPainter::drawTextItem(), drawTextItemDecoration(), QPdfEnginePrivate::embedFont(), QVGFontEngineCleaner::fontEngineDestroyed(), QFontEngine::getGlyphBearings(), QFontEngine::getGlyphPositions(), QTextLine::glyphs(), QTextDocumentLayoutPrivate::hitTest(), QFontEngineMac::imageForGlyph(), QFontEngineDirectWrite::imageForGlyph(), QTextLine::layout_helper(), QTextDocumentLayoutPrivate::layoutBlock(), QTextDocumentLayoutPrivate::layoutFlow(), QTextDocumentLayoutPrivate::layoutFrame(), QRawFont::leading(), QFontMetricsF::leading(), QFont::letterSpacing(), QFontMetricsF::lineWidth(), QFontEngineFT::loadGlyph(), QTextLine::naturalTextRect(), operator<<(), QTextureGlyphCache::populate(), QPainterReplayer::process(), QFreetypeFace::properties(), QFontEngine::properties(), qt_draw_decoration_for_glyphs(), QTextInlineObject::rect(), QTextLine::rect(), QFontMetricsF::tightBoundingRect(), QFixedPoint::toPointF(), QFixedSize::toSizeF(), QFontSubset::toTruetype(), QFontSubset::type1AddedGlyphs(), QFontMetricsF::underlinePos(), QRawFont::unitsPerEm(), QTextItem::width(), QFontMetricsF::width(), QFont::wordSpacing(), QRawFont::xHeight(), and QFontMetricsF::xHeight().

77 { return ((qreal)val)/(qreal)64; }
double qreal
Definition: qglobal.h:1193
int val
Definition: qfixed_p.h:154

◆ truncate()

int QFixed::truncate ( ) const
inline

Definition at line 79 of file qfixed_p.h.

Referenced by QTextDocumentLayoutPrivate::layoutTable(), QTextureGlyphCache::populate(), and qFloor().

79 { return val>>6; }
int val
Definition: qfixed_p.h:154

◆ value()

int QFixed::value ( ) const
inline

Properties

◆ val

int QFixed::val
private

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