Skip to content

Instantly share code, notes, and snippets.

@bzar
Created August 25, 2016 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzar/e70af4ae3ee2fcd40f19f0f5b2238dbb to your computer and use it in GitHub Desktop.
Save bzar/e70af4ae3ee2fcd40f19f0f5b2238dbb to your computer and use it in GitHub Desktop.
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QCursor>
#include "key_emitter.h"
#include "raspberrybacklight.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
#ifdef Q_PROCESSOR_ARM
app.setOverrideCursor(QCursor(Qt::BlankCursor));
#endif
QQmlApplicationEngine engine;
QObject::connect(&engine, &QQmlApplicationEngine::quit, &app, QGuiApplication::quit);
QQmlContext* ctx = engine.rootContext();
KeyEmitter keyEmitter;
ctx->setContextProperty("vkey", &keyEmitter);
RaspberryBacklight backlight;
ctx->setContextProperty("backlight", &backlight);
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
return app.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment