-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
22 lines (20 loc) · 808 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "mainwindow.h"
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
UnifindMap m;
MainWindow w;
QObject::connect(&m, &UnifindMap::initmap, &w, &MainWindow::initMap);
QObject::connect(&m, &UnifindMap::moving, &w, &MainWindow::refresh);
QObject::connect(&w, &MainWindow::tryup, &m, &UnifindMap::Up);
QObject::connect(&w, &MainWindow::trydown, &m, &UnifindMap::Down);
QObject::connect(&w, &MainWindow::tryleft, &m, &UnifindMap::Left);
QObject::connect(&w, &MainWindow::tryright, &m, &UnifindMap::Right);
QObject::connect(&w, &MainWindow::help, &w, &MainWindow::cheet);
QObject::connect(&m, &UnifindMap::win, &w, &MainWindow::gameover);
m.run();
w.show();
return a.exec();
}