Skip to content
Snippets Groups Projects
Commit 0815734e authored by Delplanque Sara's avatar Delplanque Sara
Browse files

lien gamemanager

parent f8ad2a73
No related branches found
No related tags found
No related merge requests found
.DS_Store 0 → 100644
File added
...@@ -7,6 +7,7 @@ Window { ...@@ -7,6 +7,7 @@ Window {
height: 500 height: 500
title: qsTr("Application 2048") title: qsTr("Application 2048")
Rectangle{ Rectangle{
width:100;height:100 width:100;height:100
color:"orange" color:"orange"
......
#include <QGuiApplication> #include <QGuiApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQmlContext>
#include "gamemanager.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
GameManager gameManager;
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
QObject::connect( QObject::connect(
...@@ -12,7 +14,8 @@ int main(int argc, char *argv[]) ...@@ -12,7 +14,8 @@ int main(int argc, char *argv[])
&app, &app,
[]() { QCoreApplication::exit(-1); }, []() { QCoreApplication::exit(-1); },
Qt::QueuedConnection); Qt::QueuedConnection);
engine.rootContext()->setContextProperty("gameManager", &gameManager);
engine.loadFromModule("applicationQT2048", "Main"); engine.loadFromModule("applicationQT2048", "Main");
return app.exec(); return app.exec();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment