-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (22 loc) · 730 Bytes
/
Copy pathmain.cpp
File metadata and controls
26 lines (22 loc) · 730 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
#include <QApplication>
#include <QMessageBox>
#include <QStandardPaths>
#include <QDir>
#include "database.h"
#include "mainwindow.h"
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
app.setApplicationName("MinePriceCalc");
app.setOrganizationName("MinePriceCalc");
QString data_dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
QDir().mkpath(data_dir);
QString db_path = data_dir + "/minepricecalc.db";
if (!Database::instance().init(db_path)) {
QMessageBox::critical(nullptr, "Erro ao iniciar banco de dados",
Database::instance().lastError());
return 1;
}
MainWindow window;
window.show();
return app.exec();
}