1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

Draw qBittorrent version on splashscreen at run time

This commit is contained in:
Christophe Dumez 2010-11-04 19:31:12 +00:00
parent 5c2b57052b
commit 583b8c60bb
2 changed files with 10 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -37,6 +37,9 @@
#include <QStyleFactory>
#include <QStyle>
#include <QSplashScreen>
#include <QPainter>
#include <QPen>
#include <QFont>
#include <QPushButton>
#include <QTimer>
#include "sessionapplication.h"
@ -253,7 +256,13 @@ int main(int argc, char *argv[]){
}
QSplashScreen *splash = 0;
if(!no_splash) {
splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/Icons/skin/splash.png")), Qt::WindowStaysOnTopHint);
QPixmap splash_img(":/Icons/skin/splash.png");
QPainter painter(&splash_img);
QString version = VERSION;
painter.setPen(QPen(Qt::white));
painter.setFont(QFont("Arial", 22, QFont::Black));
painter.drawText(224 - painter.fontMetrics().width(version), 270, version);
splash = new QSplashScreen(splash_img, Qt::WindowStaysOnTopHint);
splash->show();
app.processEvents();
QTimer::singleShot(2000, splash, SLOT(deleteLater()));