18 #include <QCoreApplication>
20 #include <QElapsedTimer>
25 : QSplashScreen(QPixmap(
":/images/splashscreen.png")), m_percentage_done(0)
28 QSplashScreen::setCursor(Qt::BusyCursor);
33 QSplashScreen::setFont(font);
39 QTime dieTime = QTime::currentTime().addMSecs(show_during);
42 while (QTime::currentTime() < dieTime) {
44 QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
60 QSplashScreen::drawContents(painter);
62 auto img_rect = frameGeometry();
65 QRect textRect(img_rect.width() * 0.02, img_rect.height() - char_height * 2.5,
66 img_rect.width() * 0.5, char_height * 3);
69 style()->drawItemText(painter, textRect, 0, this->palette(),
true, versionText);
71 QString loadingText(
"loading . ");
73 loadingText.append(
". ");
76 QRect loadingRect(img_rect.width() * 0.8, img_rect.height() - char_height * 2.5,
77 img_rect.width(), char_height * 3);
78 style()->drawItemText(painter, loadingRect, 0, this->palette(),
true, loadingText);
Defines class GUIHelpers functions.
Defines class SplashScreen.
DefinesStyleUtils namespace.
SplashScreen(QWidget *parent=nullptr)
void drawContents(QPainter *painter)
void start(int show_during=1500)
void setProgress(int value)
QString getBornAgainVersionString()
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
int SystemPointSize()
Returns size in points of default system font.