#include "fbsplash.h" #include "ui_fbsplash.h" //----------------------------------------------------------------------------- fbsplash::fbsplash(QWidget *parent) : QWidget(parent), ui(new Ui::fbsplash) { ui->setupUi(this); createActions(); QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(increaseProgressBar())); timer->start(100); setWindowFlags(Qt::FramelessWindowHint); showFullScreen(); } //----------------------------------------------------------------------------- fbsplash::~fbsplash() { delete ui; } //----------------------------------------------------------------------------- void fbsplash::setupTheme() { // TODO: set styles from config file (or default theme) } //----------------------------------------------------------------------------- void fbsplash::createActions() { // For testing: quit through CTRL + X _quit = new QAction(tr("&quit"), this); _quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X)); this->addAction(_quit); connect(_quit, SIGNAL(triggered()), this, SLOT(close())); // per default, QT closes the app when the last widget is closed } void fbsplash::increaseProgressBar() { int currentValue = ui->progressBar->value(); if (currentValue < 100) ui->progressBar->setValue(currentValue + 1); else ui->progressBar->setValue(0); }