iCub-main
Loading...
Searching...
No Matches
icub-main
src
tools
frameGrabberGui2
loadingwidget.cpp
Go to the documentation of this file.
1
#include "
loadingwidget.h
"
2
#include "ui_loadingwidget.h"
3
4
LoadingWidget::LoadingWidget
(QWidget *parent) :
5
QDialog(parent),
6
ui(new
Ui
::
LoadingWidget
)
7
{
8
ui->setupUi(
this
);
9
counter=0;
10
11
setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
12
setAttribute(Qt::WA_TranslucentBackground);
13
14
setModal(
true
);
15
16
17
splashTimer.setInterval(50);
18
splashTimer.setSingleShot(
false
);
19
connect(&splashTimer,SIGNAL(timeout()),
this
,SLOT(onSplashTimer()),Qt::DirectConnection);
20
}
21
22
LoadingWidget::~LoadingWidget
()
23
{
24
delete
ui;
25
}
26
27
28
void
LoadingWidget::onSplashTimer()
29
{
30
QString name = QString(
":/images/splash/bg%1.png"
).arg(counter+1);
31
counter++;
32
counter = counter % 8;
33
ui->loadingIco->setPixmap(QPixmap(name));
34
ui->loadingIco->repaint();
35
}
36
37
38
int
LoadingWidget::start
()
39
{
40
mutex.lock();
41
splashTimer.start();
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());
46
mutex.unlock();
47
return
exec();
48
}
49
50
void
LoadingWidget::stop
()
51
{
52
mutex.lock();
53
splashTimer.stop();
54
mutex.unlock();
55
}
LoadingWidget
Definition
loadingwidget.h:12
LoadingWidget::~LoadingWidget
~LoadingWidget()
Definition
loadingwidget.cpp:22
LoadingWidget::stop
void stop()
Definition
loadingwidget.cpp:50
LoadingWidget::start
int start()
Definition
loadingwidget.cpp:38
LoadingWidget::LoadingWidget
LoadingWidget(QWidget *parent=0)
Definition
loadingwidget.cpp:4
x
x
Definition
compute_ekf_sym.m:21
Ui
Definition
calibrationwindow.h:18
y
y
Definition
show_eyes_axes.m:21
loadingwidget.h
Generated on Wed Dec 18 2024 16:34:48 for iCub-main by
1.9.8