diff options
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r-- | src/gui/text/qfont.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 49b5a9ba46..83f2d7190b 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -2073,6 +2073,18 @@ QString QFont::toString() const QString::number((int) rawMode()); } +/*! + Returns the hash value for \a font. If specified, \a seed is used + to initialize the hash. + + \relates QFont + \since 5.3 +*/ +uint qHash(const QFont &font, uint seed) Q_DECL_NOTHROW +{ + return qHash(QFontPrivate::get(font)->request, seed); +} + /*! Sets this font to match the description \a descrip. The description @@ -2533,8 +2545,10 @@ bool QFontInfo::fixedPitch() const QChar ch[2] = { QLatin1Char('i'), QLatin1Char('m') }; QGlyphLayoutArray<2> g; int l = 2; - engine->stringToCMap(ch, 2, &g, &l, 0); - engine->fontDef.fixedPitch = g.advances_x[0] == g.advances_x[1]; + if (!engine->stringToCMap(ch, 2, &g, &l, 0)) + Q_UNREACHABLE(); + Q_ASSERT(l == 2); + engine->fontDef.fixedPitch = g.advances[0] == g.advances[1]; engine->fontDef.fixedPitchComputed = true; } #endif |