do not inherit QObject from QFontEngine

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-20 22:03:24 +03:00
parent 04df82a5b2
commit f6bec01cb2
3 changed files with 8 additions and 17 deletions

View file

@ -1329,11 +1329,13 @@ void QFontCache::clear()
EngineCache::ConstIterator it = engineCache.constBegin(),
end = engineCache.constEnd();
while (it != end) {
if (!it.value()->ref.deref())
delete it.value();
else
QFontEngine* engine = it.value();
if (!engine->ref.deref()) {
delete engine;
} else {
FC_DEBUG("QFontCache::~QFontCache: engineData %p still has refcount %d",
it.value(), int(it.value()->ref));
engine, int(engine->ref));
}
++it;
}

View file

@ -36,16 +36,11 @@ QT_BEGIN_NAMESPACE
// QFontEngine
QFontEngine::QFontEngine()
: QObject(),
ref(1)
: ref(1)
{
fsType = 0;
}
QFontEngine::~QFontEngine()
{
}
QFixed QFontEngine::lineThickness() const
{
// ad hoc algorithm
@ -304,10 +299,6 @@ QFontEngineBox::QFontEngineBox(int size)
{
}
QFontEngineBox::~QFontEngineBox()
{
}
bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags) const
{
if (*nglyphs < len) {

View file

@ -57,7 +57,7 @@ struct QGlyphLayout;
)
class Q_GUI_EXPORT QFontEngine : public QObject
class Q_GUI_EXPORT QFontEngine
{
public:
enum Type {
@ -66,7 +66,6 @@ public:
};
QFontEngine();
virtual ~QFontEngine();
// all of these are in unscaled metrics if the engine supports uncsaled metrics,
// otherwise in design metrics
@ -175,7 +174,6 @@ class QFontEngineBox : public QFontEngine
{
public:
QFontEngineBox(int size);
~QFontEngineBox();
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
virtual void recalcAdvances(QGlyphLayout *) const;