-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathloader.cpp
More file actions
41 lines (37 loc) · 935 Bytes
/
loader.cpp
File metadata and controls
41 lines (37 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include "loader.h"
#include "ui_loader.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QTimer>
#include <QWidget>
using namespace std;
loader::loader(QWidget *parent) :
QFrame(parent),
ui(new Ui::loader)
{
ui->setupUi(this);
/* start timer */
this->progression = 0;
this->timer = new QTimer(this);
connect( this->timer, SIGNAL(timeout()), this, SLOT(onLoad()));
this->timer->start(50);
}
loader::~loader()
{
delete ui;
}
void loader::onLoad(){
this->progression++;
ui->progressBar->setValue(this->progression);
if (this->progression == 100){
this->timer->stop();
/* show the mainWindow */
MainWindow *w = new MainWindow(this);
QWidget * q = new QWidget(w->window());
//w->show();
//this->setParent(q);
//this->hide();
this->close();
}
}