YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
loadingwidget.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
7#include "ui_loadingwidget.h"
8
10 QDialog(parent),
11 ui(new Ui::LoadingWidget),
12 counter(0)
13{
14 ui->setupUi(this);
15 setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
16 setAttribute(Qt::WA_TranslucentBackground);
17 setModal(true);
18 splashTimer.setInterval(50);
19 splashTimer.setSingleShot(false);
20 connect(&splashTimer,SIGNAL(timeout()),this,SLOT(onSplashTimer()),Qt::DirectConnection);
21}
22
24{
25 delete ui;
26}
27
28
29void LoadingWidget::onSplashTimer()
30{
31 QString name = QString(":/images/splash/bg%1.png").arg(counter+1);
32 counter++;
33 counter = counter % 8;
34 ui->loadingIco->setPixmap(QPixmap(name));
35 ui->loadingIco->repaint();
36}
37
38
40{
41 QWidget *w =((QWidget*)parent());
42 int x = w->x() + ((w->width() - width()) / 2);
43 int y = w->y() + ((w->height() - height()) / 2);
44 this->setGeometry(x,y,width(),height());
45 splashTimer.start();
46 return exec();
47}
48
50{
51 splashTimer.stop();
52}
int SIGNAL(int pid, int signum)
LoadingWidget(QWidget *parent=0)
Definition aboutdlg.h:11