-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
22 lines (17 loc) · 752 Bytes
/
main.cpp
File metadata and controls
22 lines (17 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "Chip8.h"
#include "Chip8ScreenProvider.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
Chip8 chip8;
Chip8ScreenProvider* chip8ScreenProvider = new Chip8ScreenProvider;
chip8ScreenProvider->setChip8(&chip8);
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("chip8", &chip8);
engine.addImageProvider(QLatin1String("chip8Screen"), chip8ScreenProvider);// nous passons ensuite notre object Chip8Screen comme contextProperty dans notre QML. C'est ainsi que nous pourrons l'utiliser.
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}