summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2024-07-26 17:49:18 +0200
committerOrangerot <purple@orangerot.dev>2024-07-26 17:49:18 +0200
commita5ba031c9dfc830d3fe44e868c5fd26af2fbb225 (patch)
tree7142f49c4cbfaa607a42530e67918c120bc071c8 /main.cpp
parentf039734dddd1262909219ed14d9bf07e4d35ff81 (diff)
feat(qt): simple qt qml application
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index bc8f460..4796716 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,6 +1,19 @@
-#include <iostream>
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QQmlComponent>
-int main() {
- std::cout << "Hello, World!" << std::endl;
- return 0;
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlEngine engine;
+ QQmlContext *objectContext = new QQmlContext(engine.rootContext());
+
+ QQmlComponent component(&engine, "application.qml");
+ QObject *object = component.create(objectContext);
+
+ // ... delete object and objectContext when necessary
+
+ return app.exec();
}