QtGui/qfontmetrics.h Source File
Go to the documentation of this file.
42 #ifndef QFONTMETRICS_H
43 #define QFONTMETRICS_H
47 #ifndef QT_INCLUDE_COMPAT
74 #ifdef Q_COMPILER_RVALUE_REFS
76 {
qSwap(d, other.d);
return *
this; }
83 int lineSpacing()
const;
84 int minLeftBearing()
const;
85 int minRightBearing()
const;
89 int averageCharWidth()
const;
91 bool inFont(
QChar)
const;
92 bool inFontUcs4(uint ucs4)
const;
94 int leftBearing(
QChar)
const;
95 int rightBearing(
QChar)
const;
100 int charWidth(
const QString &str,
int pos)
const;
105 QRect boundingRect(
const QRect &
r,
int flags,
const QString &text,
int tabstops=0,
int *tabarray=0)
const;
107 int tabstops=0,
int *tabarray=0)
const
108 {
return boundingRect(
QRect(x, y, w, h), flags, text, tabstops, tabarray); }
109 QSize size(
int flags,
const QString& str,
int tabstops=0,
int *tabarray=0)
const;
115 int underlinePos()
const;
116 int overlinePos()
const;
117 int strikeOutPos()
const;
118 int lineWidth()
const;
126 inline QRect boundingRect(
const QString &text,
int len)
const
127 {
return boundingRect(text.
left(len)); }
128 inline QRect boundingRect(
int x,
int y,
int w,
int h,
int flags,
const QString& str,
int len,
129 int tabstops=0,
int *tabarray=0)
const
130 {
return boundingRect(
QRect(x, y, w, h), flags, str.
left(len), tabstops, tabarray); }
131 inline QSize size(
int flags,
const QString& str,
int len,
int tabstops=0,
int *tabarray=0)
const
132 {
return size(flags, str.
left(len), tabstops, tabarray); }
135 #if defined(Q_WS_MAC)
136 friend class QFontPrivate;
139 friend class QStackTextEngine;
156 #ifdef Q_COMPILER_RVALUE_REFS
158 {
qSwap(d, other.d);
return *
this; }
160 qreal ascent()
const;
161 qreal descent()
const;
163 qreal leading()
const;
164 qreal lineSpacing()
const;
165 qreal minLeftBearing()
const;
166 qreal minRightBearing()
const;
167 qreal maxWidth()
const;
169 qreal xHeight()
const;
170 qreal averageCharWidth()
const;
172 bool inFont(
QChar)
const;
173 bool inFontUcs4(uint ucs4)
const;
175 qreal leftBearing(
QChar)
const;
176 qreal rightBearing(
QChar)
const;
183 QRectF boundingRect(
const QRectF &r,
int flags,
const QString&
string,
int tabstops=0,
int *tabarray=0)
const;
184 QSizeF size(
int flags,
const QString& str,
int tabstops=0,
int *tabarray=0)
const;
190 qreal underlinePos()
const;
191 qreal overlinePos()
const;
192 qreal strikeOutPos()
const;
193 qreal lineWidth()
const;
208 #endif // QFONTMETRICS_H
GLdouble GLdouble GLdouble r
QString left(int n) const Q_REQUIRED_RESULT
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
#define QT_BEGIN_NAMESPACE
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
GLenum GLsizei GLsizei height
bool operator!=(const QByteArray &a1, const QByteArray &a2)
int int int int int int h
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text, int tabstops=0, int *tabarray=0) const
GLubyte GLubyte GLubyte GLubyte w