/
loadingdialog.h
executable file
·55 lines (43 loc) · 1.04 KB
/
loadingdialog.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef LOADINGDIALOG_H
#define LOADINGDIALOG_H
#include <QDialog>
#include <QThread>
#include <iostream>
#include <QTimer>
#include "qt/transcendence/prunnable.h"
namespace Ui {
class LoadingDialog;
}
class Worker : public QObject {
Q_OBJECT
public:
Worker(Runnable* runnable, int type):runnable(runnable), type(type){}
~Worker(){}
public slots:
void process();
signals:
void finished();
void error(QString err,int type);
private:
Runnable* runnable;
int type;
};
class LoadingDialog : public QDialog
{
Q_OBJECT
public:
explicit LoadingDialog(QWidget *parent = nullptr);
~LoadingDialog();
void execute(Runnable *runnable, int type);
public slots:
void finished();
void loadingTextChange();
private:
Ui::LoadingDialog *ui;
QTimer *loadingTimer = nullptr;
int loading = 0;
};
#endif // LOADINGDIALOG_H