diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-09-09 11:46:50 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-10 01:56:20 +0200 |
commit | 106843ad1afa2f5c0aedaa748088d4ebacd6d73d (patch) | |
tree | 4d6059989e0177d71ca8962b86de9dc255c46dea /src/gui/text/qfontengine_p.h | |
parent | 8b124a7ddefbacea60d2e5d44e39eed4aa83bec5 (diff) |
Make QFontEngine not derive from QObject
Whilst having the objectName set for each engine is
somewhat handy when debugging, deriving from QObject just for that
is a wasting of memory in all other cases.
This also broke the font engine abstraction by allowing qobject_cast()
to access some private data; the only sane way to distinguish
engines is querying their Type value.
Change-Id: Ib1d195692859eb39089f6d8d9016cb8f9dcc0400
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui/text/qfontengine_p.h')
-rw-r--r-- | src/gui/text/qfontengine_p.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 4427000d03..1a6862898d 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -86,9 +86,8 @@ enum HB_Compat_Error { typedef void (*qt_destroy_func_t) (void *user_data); -class Q_GUI_EXPORT QFontEngine : public QObject +class Q_GUI_EXPORT QFontEngine { - Q_OBJECT public: enum Type { Box, @@ -300,9 +299,13 @@ public: QImage currentlyLockedAlphaMap; int m_subPixelPositionCount; // Number of positions within a single pixel for this cache + inline QVariant userData() const { return m_userData; } + protected: QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false); + inline void setUserData(const QVariant &userData) { m_userData = userData; } + private: struct GlyphCacheEntry { const void *context; @@ -311,6 +314,9 @@ private: }; mutable QLinkedList<GlyphCacheEntry> m_glyphCaches; + +private: + QVariant m_userData; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QFontEngine::ShaperFlags) @@ -368,7 +374,6 @@ private: class Q_GUI_EXPORT QFontEngineMulti : public QFontEngine { - Q_OBJECT public: explicit QFontEngineMulti(int engineCount); ~QFontEngineMulti(); |