tools/map_templates_tool/main.cpp
author unC0Rr
Tue, 17 Dec 2024 15:44:21 +0100
branchtransitional_engine
changeset 16049 db18f1a30b0c
parent 16043 adb44a2d8226
permissions -rw-r--r--
Implement passing of available ammo to rust AI
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16043
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     1
#include <QGuiApplication>
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     2
#include <QQmlApplicationEngine>
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     3
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     4
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     5
int main(int argc, char *argv[])
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     6
{
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     7
    QGuiApplication app(argc, argv);
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     8
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
     9
    QQmlApplicationEngine engine;
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    10
    const QUrl url(u"qrc:/map_templates_tool/main.qml"_qs);
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    11
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    12
                     &app, [url](QObject *obj, const QUrl &objUrl) {
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    13
        if (!obj && url == objUrl)
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    14
            QCoreApplication::exit(-1);
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    15
    }, Qt::QueuedConnection);
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    16
    engine.load(url);
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    17
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    18
    return app.exec();
adb44a2d8226 Add a tool visualizing map templates
unC0Rr
parents:
diff changeset
    19
}