-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
57 lines (46 loc) · 1.78 KB
/
main.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
53
54
55
56
57
#include <QWidget>
#include <QVBoxLayout>
#include <QTabWidget>
#include <QApplication>
#include <QFile>
#include <QFontDatabase>
#include <QStandardPaths>
#include <QDir>
#include "todolist.h"
#include "habittracker.h"
#include "weeklyschedule.h"
#include "impossiblelist.h"
QString Feature::__databasePath = "";
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setOrganizationName("SAA");
a.setApplicationName("Productivity-App");
Feature::__databasePath = QString("%1/%2/").arg(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).arg(a.applicationName());
QDir databaseDir(Feature::__databasePath);
if(!databaseDir.exists())
databaseDir.mkdir(Feature::__databasePath);
QWidget container;
container.setObjectName("container");
QVBoxLayout * layout = new QVBoxLayout();
container.setLayout(layout);
container.setMinimumWidth(1000);
container.setMinimumHeight(650);
QFontDatabase::addApplicationFont(":/resources/Roboto-Medium.ttf");
QTabWidget * parentWidget = new QTabWidget(&container);
layout->addWidget(parentWidget);
QFile stylesheetSource(":/resources/stylesheet.qss");
stylesheetSource.open(QFile::ReadOnly);
QString stylesheet = QLatin1String(stylesheetSource.readAll());
a.setStyleSheet(stylesheet);
TodoList * __todolist = new TodoList(&container);
HabitTracker * __habitTracker = new HabitTracker(&container);
WeeklySchedule * __weeklySchedule = new WeeklySchedule(&container);
ImpossibleList * __impossibleList = new ImpossibleList(&container);
__todolist->v_display(parentWidget);
__habitTracker->v_display(parentWidget);
__weeklySchedule->v_display(parentWidget);
__impossibleList->v_display(parentWidget);
container.show();
return a.exec();
}