mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix Qt dep warn and remove XLFD font workaround
This commit fixes a few warnings from Qt 5.14 regarding
QFont::setRawName() and QFont::rawName() like the following one:
error: ‘void QFont::setRawName(const QString&)’ is deprecated [-Werror=deprecated-declarations]
These methods were deprecated in Qt 5.3. [1]
This commit removes code from 2002 (539ce478
) that worked around a
problem in Qt's handling of XLFD fonts that no longer seems relevant
since XLFD is no longer supported in Qt 5 [2]. Even if the problem
were relevant, setRawName() would not fix anything since it is now
an empty method. [3]
I tested that compilation with Qt 4.8.7 works without error.
[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.3.0/?h=v5.14.0
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3a8d7b0b9a4db91415b7bda2582a59a76b3754dc
[3] https://codereview.qt-project.org/c/qt/qtbase/+/100292/
This commit is contained in:
parent
8583410617
commit
d4ff3a2959
@ -126,17 +126,6 @@ GuiFontInfo & fontinfo(FontInfo const & f)
|
||||
}
|
||||
|
||||
|
||||
QString rawName(QString const & family)
|
||||
{
|
||||
for (size_t i = 0; i < nr_symbol_fonts; ++i)
|
||||
if (family == symbol_fonts[i].family)
|
||||
return symbol_fonts[i].xlfd;
|
||||
|
||||
LYXERR(Debug::FONT, "BUG: family not found !");
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
QString symbolFamily(FontFamily family)
|
||||
{
|
||||
for (size_t i = 0; i < nr_symbol_fonts; ++i) {
|
||||
@ -215,11 +204,8 @@ QFont symbolFont(QString const & family, bool * ok)
|
||||
return font;
|
||||
}
|
||||
|
||||
// A simple setFamily() fails on Qt 2
|
||||
|
||||
QString const raw = rawName(family);
|
||||
LYXERR(Debug::FONT, "Trying " << raw << " ... ");
|
||||
font.setRawName(raw);
|
||||
LYXERR(Debug::FONT, "Trying " << family << " ... ");
|
||||
font.setFamily(family);
|
||||
|
||||
if (isChosenFont(font, family, QString())) {
|
||||
LYXERR(Debug::FONT, "raw version!");
|
||||
@ -359,8 +345,6 @@ QFont makeQFont(FontInfo const & f)
|
||||
else
|
||||
LYXERR(Debug::FONT, "This font is NOT an exact match");
|
||||
|
||||
LYXERR(Debug::FONT, "XFLD: " << font.rawName());
|
||||
|
||||
font.setPointSizeF(f.realSize() * lyxrc.currentZoom / 100.0);
|
||||
|
||||
LYXERR(Debug::FONT, "The font has size: " << font.pointSizeF());
|
||||
|
Loading…
Reference in New Issue
Block a user