Changeset View
Changeset View
Standalone View
Standalone View
examples/todos/src/main.cpp
1 | #include "Bindings.h" | 1 | #include "Bindings.h" | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | #include <QtQml/qqml.h> | 3 | #include <QGuiApplication> | ||
4 | #include <QApplication> | | |||
5 | #include <QQmlApplicationEngine> | 4 | #include <QQmlApplicationEngine> | ||
6 | 5 | | |||
7 | int main(int argc, char *argv[]) | 6 | int main(int argc, char *argv[]) | ||
8 | { | 7 | { | ||
9 | QApplication app(argc, argv); | 8 | QGuiApplication app(argc, argv); | ||
10 | qmlRegisterType<Todos>("RustCode", 1, 0, "Todos"); | 9 | qmlRegisterType<Todos>("RustCode", 1, 0, "Todos"); | ||
11 | 10 | | |||
12 | QQmlApplicationEngine engine; | 11 | QQmlApplicationEngine engine; | ||
13 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); | 12 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); | ||
14 | if (engine.rootObjects().isEmpty()) | 13 | if (engine.rootObjects().isEmpty()) | ||
15 | return -1; | 14 | return -1; | ||
16 | 15 | | |||
17 | return app.exec(); | 16 | return app.exec(); | ||
18 | } | 17 | } |