-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
38 lines (24 loc) · 946 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "headers/database.h"
#include "headers/listmodel.h"
#include <QQmlContext>
#include "headers/contract.h"
#include "headers/salesman.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QGuiApplication::setApplicationName("EMPLOYEES MANAGEMENT");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QQmlApplicationEngine engine;
DataBase database;
ListModel *model = new ListModel();
ConModel *modell = new ConModel();
SalesModel *modus = new SalesModel();
engine.rootContext()->setContextProperty("myModel", model);
engine.rootContext()->setContextProperty("maxModel", modell);
engine.rootContext()->setContextProperty("maximeModel", modus);
engine.rootContext()->setContextProperty("database", &database);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}