mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 02:35:38 +03:00
14.06.2023
This commit is contained in:
46
s1000d/Converter_Source/splashform.cpp
Normal file
46
s1000d/Converter_Source/splashform.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "splashform.h"
|
||||
#include "ui_splashform.h"
|
||||
#include <QDesktopWidget>
|
||||
#include <qdebug.h>
|
||||
#include <QMessageBox>
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user