-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.cpp
52 lines (42 loc) · 939 Bytes
/
mainwindow.cpp
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
#include <QString>
#include <QPixmap>
#include <QApplication>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <iostream>
using namespace std;
MainWindow * MainWindow::pMainWindow = nullptr;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
// kind of singleton reference.
MainWindow *MainWindow::getMainWinPtr()
{
return pMainWindow;
}
void MainWindow::closeEvent(QCloseEvent *event) {
exit(0);
}
void MainWindow::setText(QPixmap image, int width, int height)
{
ui->image_label->setPixmap(image);
ui->image_label->setGeometry(0, 0, width, height);
}
void MainWindow::setText(QString text)
{
ui->image_label->setText(text);
}
void MainWindow::on_btnLoad_clicked()
{
cout << "" << "Load";
}
void MainWindow::updateProgress(int value) {
ui->progressSlider->setValue(value);
}