#include "splashform.h" #include "ui_splashform.h" #include #include #include SplashForm::SplashForm(QWidget *parent) : QDialog(parent), ui(new Ui::SplashForm) { ui->setupUi(this); QDesktopWidget desktop; QRect rect = desktop.availableGeometry(this); QPoint center = rect.center(); int x = center.x() - (width()/2); int y = center.y() - (height()/2); center.setX(x); center.setY(y); this->move(center); this->setWindowFlag(Qt::SplashScreen, true); this->setWindowFlag(Qt::WindowStaysOnTopHint, true); } SplashForm::~SplashForm() { delete ui; } void SplashForm::Reset() { ui->progressBar->setValue(100); ui->lblTitle->setText("Задумались..."); } void SplashForm::Step() { if(ui->progressBar->value() >= 100) ui->progressBar->setValue(0); else ui->progressBar->setValue(ui->progressBar->value()+1); } void SplashForm::SetTitle(QString title) { ui->lblTitle->setText(title); } void SplashForm::ErrMessage(QString title, QString msg) { QMessageBox::critical(this,title,msg,QMessageBox::Ok); }