summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfont_p.h')
-rw-r--r--src/gui/text/qfont_p.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 5b7f918e21..6165554388 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -55,6 +55,7 @@
#include "QtGui/qfont.h"
#include "QtCore/qmap.h"
+#include "QtCore/qhash.h"
#include "QtCore/qobject.h"
#include "QtCore/qstringlist.h"
#include <QtGui/qfontdatabase.h>
@@ -133,6 +134,22 @@ struct QFontDef
}
};
+inline uint qHash(const QFontDef &fd, uint seed = 0) Q_DECL_NOTHROW
+{
+ return qHash(qRound64(fd.pixelSize*10000)) // use only 4 fractional digits
+ ^ qHash(fd.weight)
+ ^ qHash(fd.style)
+ ^ qHash(fd.stretch)
+ ^ qHash(fd.styleHint)
+ ^ qHash(fd.styleStrategy)
+ ^ qHash(fd.ignorePitch)
+ ^ qHash(fd.fixedPitch)
+ ^ qHash(fd.family, seed)
+ ^ qHash(fd.styleName)
+ ^ qHash(fd.hintingPreference)
+ ;
+}
+
class QFontEngineData
{
public: