38 #include <QCoreApplication> 46 const int bottom_border = 27;
47 QPixmap splash( pixmap.width(), pixmap.height()+bottom_border );
48 splash.fill( QColor(0,0,0) );
50 QPainter painter( &splash );
52 painter.drawPixmap( QPoint(0,0), pixmap );
54 QPixmap overlay =
loadPixmap(
"package://rviz/images/splash_overlay.png" );
55 painter.drawTiledPixmap( QRect( 0,pixmap.height()-overlay.height(), pixmap.width(),pixmap.height() ), overlay );
58 QString version_info =
"r"+QString(
get_version().c_str());
59 version_info +=
" (" + QString(
get_distro().c_str()) +
")";
61 painter.setPen( QColor(160,160,160) );
62 QRect
r = splash.rect();
63 r .setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
64 painter.drawText( r, Qt::AlignRight | Qt::AlignBottom, version_info );
71 QSplashScreen::showMessage( message, Qt::AlignLeft | Qt::AlignBottom, Qt::white );
std::string get_version()
SplashScreen(const QPixmap &pixmap)
void showMessage(const QString &message)
QPixmap loadPixmap(QString url, bool fill_cache)