summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2024-08-15 01:24:36 +0200
committerOrangerot <purple@orangerot.dev>2024-08-15 01:24:36 +0200
commitd55c6fb611c13ad3a1fd1469a46f10335727def6 (patch)
tree8f9eebb9a547d3494be5d6472cc087ee4c82136f /main.cpp
parentefeec3b99e02fd17fc1c69a0f221d578ccc48eef (diff)
feat(QJsonModel): QT Treeview shows JSON Modelorangerot-ui
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 134229b..2413ced 100644
--- a/main.cpp
+++ b/main.cpp
@@ -23,10 +23,12 @@
// #include <iostream>
#include "QJsonModel.hpp"
+#include <QTreeView>
+#include <QApplication>
int main(int argc, char *argv[])
{
- QGuiApplication app(argc, argv);
+ QApplication app(argc, argv);
QQmlEngine engine;
QQmlContext *objectContext = new QQmlContext(engine.rootContext());
@@ -86,6 +88,11 @@ int main(int argc, char *argv[])
QQmlComponent component(&engine, "application.qml");
QObject *object = component.create(objectContext);
+
+
+ QTreeView * view = new QTreeView;
+ view->setModel(model);
+ view->show();
qDebug() << "Competitor:" << jsonObj["units"][0]["competitors"][0]["name"].toString();