-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsavegame.cpp
More file actions
38 lines (30 loc) · 857 Bytes
/
Copy pathsavegame.cpp
File metadata and controls
38 lines (30 loc) · 857 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
#include "savegame.h"
#include "ui_savegame.h"
#include "filepath.h"
#include <iomanip>
#include <fstream>
saveGame::saveGame(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::saveGame)
{
ui->setupUi(this);
}
saveGame::~saveGame()
{
delete ui;
}
void saveGame::save()
{
this->show();
std::ofstream file(SAVE_CONFIG, std::ios::app); /// connection txt file input or output
QEventLoop loop;
connect(ui->btn_save, SIGNAL(clicked(bool)), &loop, SLOT(quit())); /// signal and slots
loop.exec();
disconnect(ui->btn_save, SIGNAL(clicked(bool)), &loop, SLOT(quit()));
file << ui->lineEdit_name->text().toStdString() << std::endl; /// name
this->hide();
emit data_save(SAVE_FILE(ui->lineEdit_name->text().toStdString()));
}
void saveGame::on_btn_save_clicked()
{
}