2 #include "ui_loadingwidget.h"
11 setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
12 setAttribute(Qt::WA_TranslucentBackground);
17 splashTimer.setInterval(50);
18 splashTimer.setSingleShot(
false);
19 connect(&splashTimer,SIGNAL(timeout()),
this,SLOT(onSplashTimer()),Qt::DirectConnection);
28 void LoadingWidget::onSplashTimer()
30 QString name = QString(
":/images/splash/bg%1.png").arg(counter+1);
32 counter = counter % 8;
33 ui->loadingIco->setPixmap(QPixmap(name));
34 ui->loadingIco->repaint();
42 QWidget *w =((QWidget*)parent());
43 int x = w->x() + ((w->width() - width()) / 2);
44 int y = w->y() + ((w->height() - height()) / 2);
45 this->setGeometry(
x,
y,width(),height());