13 CSplashScreen::CSplashScreen(
const QPixmap &pixmap,
const QFont &font)
15 const int height = qFloor(pixmap.height() * 1.2);
16 const int width = pixmap.width();
17 QPixmap splash(pixmap.width(), height);
18 splash.fill(Qt::transparent);
20 QPainter painter(&splash);
21 painter.drawPixmap(0, 0, pixmap);
23 const int statusbar_height = qFloor((height - pixmap.height()) / 2.0);
24 QPixmap statusbar(width, statusbar_height);
25 statusbar.fill(QColor(200, 200, 200));
26 painter.drawPixmap(0, height - statusbar_height, statusbar);
28 this->setPixmap(splash);
32 void CSplashScreen::showStatusMessage(
const QString &msg)
34 if (msg.isEmpty()) {
return; }
35 this->showMessage(msg, Qt::AlignHCenter | Qt::AlignBottom);
Free functions in swift::misc.