Mercurial > hg > sonic-visualiser
diff main/main.cpp @ 331:067a57de45e2
* Add version number to splash screen
author | Chris Cannam |
---|---|
date | Wed, 29 Jul 2009 15:03:21 +0000 |
parents | cb189d3816e5 |
children | b168df820681 |
line wrap: on
line diff
--- a/main/main.cpp Mon Jun 22 17:06:27 2009 +0000 +++ b/main/main.cpp Wed Jul 29 15:03:21 2009 +0000 @@ -35,6 +35,9 @@ #include <QDir> #include <QSplashScreen> #include <QTimer> +#include <QPainter> + +#include "../version.h" #include <iostream> #include <signal.h> @@ -208,7 +211,6 @@ { #ifdef Q_WS_X11 #if QT_VERSION >= 0x040500 - std::cerr << "raster" << std::endl; QApplication::setGraphicsSystem("raster"); #endif #endif @@ -243,13 +245,21 @@ QApplication::setOrganizationDomain("sonicvisualiser.org"); QApplication::setApplicationName(QApplication::tr("Sonic Visualiser")); - QPixmap pixmap(":/icons/sv-splash.png"); QSplashScreen *splash = 0; QSettings settings; settings.beginGroup("Preferences"); if (settings.value("show-splash", true).toBool()) { + QPixmap pixmap(":/icons/sv-splash.png"); + QPainter painter; + painter.begin(&pixmap); + QString text = QString("v%1").arg(SV_VERSION); + painter.drawText + (pixmap.width() - painter.fontMetrics().width(text) - 10, + 10 + painter.fontMetrics().ascent(), + text); + painter.end(); splash = new QSplashScreen(pixmap); splash->show(); QTimer::singleShot(5000, splash, SLOT(hide()));