qmlfrontend/main.cpp
changeset 14875 aed75d439027
parent 14393 b6824a53d4b1
child 14936 a3ad06ac390e
equal deleted inserted replaced
14874:b96ba3c1ab67 14875:aed75d439027
     5 
     5 
     6 #include "engine_interface.h"
     6 #include "engine_interface.h"
     7 #include "game_view.h"
     7 #include "game_view.h"
     8 #include "hwengine.h"
     8 #include "hwengine.h"
     9 #include "preview_acceptor.h"
     9 #include "preview_acceptor.h"
    10 
       
    11 namespace Engine {};  // namespace Engine
       
    12 
    10 
    13 static QObject* previewacceptor_singletontype_provider(
    11 static QObject* previewacceptor_singletontype_provider(
    14     QQmlEngine* engine, QJSEngine* scriptEngine) {
    12     QQmlEngine* engine, QJSEngine* scriptEngine) {
    15   Q_UNUSED(scriptEngine)
    13   Q_UNUSED(scriptEngine)
    16 
    14 
    22   QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    20   QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    23   QGuiApplication app(argc, argv);
    21   QGuiApplication app(argc, argv);
    24 
    22 
    25   QQmlApplicationEngine engine;
    23   QQmlApplicationEngine engine;
    26 
    24 
       
    25   qRegisterMetaType<EngineInstance::SimpleEventType>();
       
    26   qRegisterMetaType<EngineInstance::LongEventType>();
       
    27   qRegisterMetaType<EngineInstance::LongEventState>();
       
    28   qRegisterMetaType<EngineInstance::PositionedEventType>();
       
    29 
    27   qmlRegisterSingletonType<PreviewAcceptor>(
    30   qmlRegisterSingletonType<PreviewAcceptor>(
    28       "Hedgewars.Engine", 1, 0, "PreviewAcceptor",
    31       "Hedgewars.Engine", 1, 0, "PreviewAcceptor",
    29       previewacceptor_singletontype_provider);
    32       previewacceptor_singletontype_provider);
    30   qmlRegisterType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine");
    33   qmlRegisterType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine");
    31   qmlRegisterType<GameView>("Hedgewars.Engine", 1, 0, "GameView");
    34   qmlRegisterType<GameView>("Hedgewars.Engine", 1, 0, "GameView");