Deprecate QFont::setRawName() and QFont::rawName()

We don't support xlfd fonts anymore and indeed QFont::setRawName()
is an empty method.

[Changelog][QtGui] QFont::setRawName() and QFont::rawName() are
deprecated.

Change-Id: Ic52d42a9bc200ba8b246dd4e28c77f84e086dad5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
bb10
Sergio Ahumada 2014-02-20 17:10:21 +01:00 committed by The Qt Project
parent 3df521dd98
commit d688b7c07c
3 changed files with 6 additions and 36 deletions

View File

@ -546,6 +546,7 @@ QFontEngineData::~QFontEngineData()
/*!
\fn QString QFont::rawName() const
\deprecated
Returns the name of the font within the underlying window system.
@ -559,6 +560,7 @@ QFontEngineData::~QFontEngineData()
/*!
\fn void QFont::setRawName(const QString &name)
\deprecated
Sets a font by its system specific name.

View File

@ -242,9 +242,11 @@ public:
{ qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; }
#endif
#if QT_DEPRECATED_SINCE(5, 3)
// needed for X11
void setRawName(const QString &);
QString rawName() const;
QT_DEPRECATED void setRawName(const QString &);
QT_DEPRECATED QString rawName() const;
#endif
QString key() const;

View File

@ -74,7 +74,6 @@ private slots:
void resetFont();
#endif
void isCopyOf();
void setFontRaw();
void italicOblique();
void insertAndRemoveSubstitutions();
void serializeSpacing();
@ -417,15 +416,6 @@ void tst_QFont::compare()
QVERIFY(font == font2);
QVERIFY(!(font < font2));
}
#if defined(Q_WS_X11)
{
QFont font1, font2;
font1.setRawName("-Adobe-Helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1");
font2.setRawName("-Adobe-Helvetica-medium-r-normal--24-240-75-75-p-130-iso8859-1");
QVERIFY(font1 != font2);
}
#endif
}
void tst_QFont::resolve()
@ -519,30 +509,6 @@ void tst_QFont::isCopyOf()
QVERIFY(!font3.isCopyOf(font));
}
void tst_QFont::setFontRaw()
{
#ifndef Q_WS_X11
QSKIP("Only tested on X11");
#else
QFont f;
f.setRawName("-*-fixed-bold-r-normal--0-0-*-*-*-0-iso8859-1");
// qDebug("font family: %s", f.family().utf8());
QFontDatabase fdb;
QStringList families = fdb.families();
bool found = false;
for (int i = 0; i < families.size(); ++i) {
QString str = families.at(i);
if (str.contains('['))
str = str.left(str.indexOf('[')-1);
if (str.toLower() == "fixed")
found = true;
}
if (!found)
QSKIP("Fixed font not available.");
QCOMPARE(QFontInfo(f).family().left(5).toLower(), QString("fixed"));
#endif
}
void tst_QFont::insertAndRemoveSubstitutions()
{
QFont::removeSubstitution("BogusFontFamily");