Merge pull request #10874 from Chocobo1/qt

Replace obsoleted Qt functions
This commit is contained in:
Mike Tzou
2019-07-02 10:57:06 +08:00
committed by GitHub
5 changed files with 32 additions and 2 deletions

View File

@@ -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);