-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (30 loc) · 972 Bytes
/
main.cpp
File metadata and controls
42 lines (30 loc) · 972 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
38
39
40
41
42
// #include <QGuiApplication>
// #include <QQmlApplicationEngine>
// int main(int argc, char *argv[])
// {
// QGuiApplication app(argc, argv);
// QQmlApplicationEngine engine;
// QObject::connect(
// &engine,
// &QQmlApplicationEngine::objectCreationFailed,
// &app,
// []() { QCoreApplication::exit(-1); },
// Qt::QueuedConnection);
// engine.loadFromModule("toDoListQml", "Main");
// return app.exec();
// }
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// ToDoList todoList;
QQmlApplicationEngine engine;
// engine.rootContext()->setContextProperty("todoList", &todoList);
engine.load(QUrl(QStringLiteral("/home/client121/Documents/ali/qt-test/toDoListQml/Main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}