Qt 4.8
Classes | Macros | Functions
qfixed_p.h File Reference
#include "QtCore/qdebug.h"
#include "QtCore/qpoint.h"
#include "QtCore/qsize.h"

Go to the source code of this file.

Classes

struct  QFixed
 
struct  QFixedPoint
 
struct  QFixedSize
 

Macros

#define QFIXED_MAX   (INT_MAX/256)
 

Functions

bool operator!= (const QFixed &f, int i)
 
bool operator!= (int i, const QFixed &f)
 
QFixed operator* (int i, const QFixed &d)
 
QFixed operator* (uint i, const QFixed &d)
 
QFixed operator+ (int i, const QFixed &d)
 
QFixed operator+ (uint i, const QFixed &d)
 
QFixedPoint operator+ (const QFixedPoint &p1, const QFixedPoint &p2)
 
QFixed operator- (int i, const QFixed &d)
 
QFixed operator- (uint i, const QFixed &d)
 
QFixedPoint operator- (const QFixedPoint &p1, const QFixedPoint &p2)
 
bool operator< (const QFixed &f, int i)
 
bool operator< (int i, const QFixed &f)
 
QDebugoperator<< (QDebug &dbg, const QFixed &f)
 
bool operator<= (const QFixed &f, int i)
 
bool operator<= (int i, const QFixed &f)
 
bool operator== (const QFixed &f, int i)
 
bool operator== (int i, const QFixed &f)
 
bool operator> (const QFixed &f, int i)
 
bool operator> (int i, const QFixed &f)
 
bool operator>= (const QFixed &f, int i)
 
bool operator>= (int i, const QFixed &f)
 
 Q_DECLARE_TYPEINFO (QFixed, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QFixedPoint, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QFixedSize, Q_PRIMITIVE_TYPE)
 
int qFloor (const QFixed &f)
 
int qRound (const QFixed &f)
 

Macro Definition Documentation

◆ QFIXED_MAX

#define QFIXED_MAX   (INT_MAX/256)

Function Documentation

◆ operator!=() [1/2]

bool operator!= ( const QFixed f,
int  i 
)
inline

Definition at line 173 of file qfixed_p.h.

173 { return f.value() != (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator!=() [2/2]

bool operator!= ( int  i,
const QFixed f 
)
inline

Definition at line 174 of file qfixed_p.h.

174 { return f.value() != (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator*() [1/2]

QFixed operator* ( int  i,
const QFixed d 
)
inline

Definition at line 163 of file qfixed_p.h.

163 { return d*i; }

◆ operator*() [2/2]

QFixed operator* ( uint  i,
const QFixed d 
)
inline

Definition at line 166 of file qfixed_p.h.

166 { return d*i; }

◆ operator+() [1/3]

QFixed operator+ ( int  i,
const QFixed d 
)
inline

Definition at line 164 of file qfixed_p.h.

164 { return d+i; }

◆ operator+() [2/3]

QFixed operator+ ( uint  i,
const QFixed d 
)
inline

Definition at line 167 of file qfixed_p.h.

167 { return d+i; }

◆ operator+() [3/3]

QFixedPoint operator+ ( const QFixedPoint p1,
const QFixedPoint p2 
)
inline

Definition at line 203 of file qfixed_p.h.

204 { return QFixedPoint(p1.x + p2.x, p1.y + p2.y); }
QFixed y
Definition: qfixed_p.h:191
QFixed x
Definition: qfixed_p.h:190

◆ operator-() [1/3]

QFixed operator- ( int  i,
const QFixed d 
)
inline

Definition at line 165 of file qfixed_p.h.

165 { return -(d-i); }

◆ operator-() [2/3]

QFixed operator- ( uint  i,
const QFixed d 
)
inline

Definition at line 168 of file qfixed_p.h.

168 { return -(d-i); }

◆ operator-() [3/3]

QFixedPoint operator- ( const QFixedPoint p1,
const QFixedPoint p2 
)
inline

Definition at line 201 of file qfixed_p.h.

202 { return QFixedPoint(p1.x - p2.x, p1.y - p2.y); }
QFixed y
Definition: qfixed_p.h:191
QFixed x
Definition: qfixed_p.h:190

◆ operator<() [1/2]

bool operator< ( const QFixed f,
int  i 
)
inline

Definition at line 179 of file qfixed_p.h.

179 { return f.value() < (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator<() [2/2]

bool operator< ( int  i,
const QFixed f 
)
inline

Definition at line 180 of file qfixed_p.h.

180 { return (i<<6) < f.value(); }
int value() const
Definition: qfixed_p.h:73

◆ operator<<()

QDebug& operator<< ( QDebug dbg,
const QFixed f 
)
inline

Definition at line 185 of file qfixed_p.h.

186 { return dbg << f.toReal(); }
qreal toReal() const
Definition: qfixed_p.h:77

◆ operator<=() [1/2]

bool operator<= ( const QFixed f,
int  i 
)
inline

Definition at line 175 of file qfixed_p.h.

175 { return f.value() <= (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator<=() [2/2]

bool operator<= ( int  i,
const QFixed f 
)
inline

Definition at line 176 of file qfixed_p.h.

176 { return (i<<6) <= f.value(); }
int value() const
Definition: qfixed_p.h:73

◆ operator==() [1/2]

bool operator== ( const QFixed f,
int  i 
)
inline

Definition at line 171 of file qfixed_p.h.

171 { return f.value() == (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator==() [2/2]

bool operator== ( int  i,
const QFixed f 
)
inline

Definition at line 172 of file qfixed_p.h.

172 { return f.value() == (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator>() [1/2]

bool operator> ( const QFixed f,
int  i 
)
inline

Definition at line 181 of file qfixed_p.h.

181 { return f.value() > (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator>() [2/2]

bool operator> ( int  i,
const QFixed f 
)
inline

Definition at line 182 of file qfixed_p.h.

182 { return (i<<6) > f.value(); }
int value() const
Definition: qfixed_p.h:73

◆ operator>=() [1/2]

bool operator>= ( const QFixed f,
int  i 
)
inline

Definition at line 177 of file qfixed_p.h.

177 { return f.value() >= (i<<6); }
int value() const
Definition: qfixed_p.h:73

◆ operator>=() [2/2]

bool operator>= ( int  i,
const QFixed f 
)
inline

Definition at line 178 of file qfixed_p.h.

178 { return (i<<6) >= f.value(); }
int value() const
Definition: qfixed_p.h:73

◆ Q_DECLARE_TYPEINFO() [1/3]

Q_DECLARE_TYPEINFO ( QFixed  ,
Q_PRIMITIVE_TYPE   
)

◆ Q_DECLARE_TYPEINFO() [2/3]

Q_DECLARE_TYPEINFO ( QFixedPoint  ,
Q_PRIMITIVE_TYPE   
)

◆ Q_DECLARE_TYPEINFO() [3/3]

Q_DECLARE_TYPEINFO ( QFixedSize  ,
Q_PRIMITIVE_TYPE   
)

◆ qFloor()

int qFloor ( const QFixed f)
inline

Definition at line 161 of file qfixed_p.h.

161 { return f.floor().truncate(); }
QFixed floor() const
Definition: qfixed_p.h:81
int truncate() const
Definition: qfixed_p.h:79

◆ qRound()

int qRound ( const QFixed f)
inline

Definition at line 160 of file qfixed_p.h.

160 { return f.toInt(); }
int toInt() const
Definition: qfixed_p.h:76