mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Replace obsoleted QFontMetrics::width()
Qt 5.13 marked QFontMetrics::width() obsolete.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user