mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
Replace obsoleted QFontMetrics::width()
Qt 5.13 marked QFontMetrics::width() obsolete.
This commit is contained in:
parent
c0557c296a
commit
4eff268095
3 changed files with 30 additions and 0 deletions
|
@ -341,7 +341,11 @@ void showSplashScreen()
|
|||
const QString version = QBT_VERSION;
|
||||
painter.setPen(QPen(Qt::white));
|
||||
painter.setFont(QFont("Arial", 22, QFont::Black));
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
|
||||
#else
|
||||
painter.drawText(224 - painter.fontMetrics().width(version), 270, version);
|
||||
#endif
|
||||
QSplashScreen *splash = new QSplashScreen(splashImg);
|
||||
splash->show();
|
||||
QTimer::singleShot(1500, splash, &QObject::deleteLater);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue