fookb-qt/fookb.cpp

25 lines
672 B
C++
Raw Permalink Normal View History

2020-03-10 16:17:18 +01:00
#include <QApplication>
#include <QQmlApplicationEngine>
2020-03-11 17:35:47 +01:00
#include <QDebug>
#include "xcbEventFilter.h"
2020-03-10 16:17:18 +01:00
int main(int argc, char *argv[])
{
2020-03-12 15:42:36 +01:00
/* create qapp and QML engine */
2020-03-10 16:17:18 +01:00
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/fookb.qml")));
2020-03-11 17:35:47 +01:00
2020-03-12 23:01:24 +01:00
/* Get the flag object */
QObject *rootObject = engine.rootObjects().first();
2020-03-12 15:42:36 +01:00
/* Install event filter to handle mapping change */
2020-03-12 23:01:24 +01:00
XcbEventFilter *eventFilter = new XcbEventFilter(rootObject);
app.installNativeEventFilter(eventFilter);
2020-03-11 17:35:47 +01:00
2020-03-12 15:42:36 +01:00
/* run application */
2020-03-10 16:17:18 +01:00
return app.exec();
}