aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 00000000..10743122
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,20 @@
+#include <QApplication>
+#include <QQmlApplicationEngine>
+
+#include "filter.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ filter *eventFilter = new filter;
+ app.installEventFilter(eventFilter);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
+ QObject *rootObject = engine.rootObjects().first();
+
+ QObject::connect(eventFilter, SIGNAL(ctrlPressed()), rootObject, SLOT(ctrlKeyPressed()));
+ QObject::connect(eventFilter, SIGNAL(ctrlReleased()), rootObject, SLOT(ctrlKeyReleased()));
+
+ return app.exec();
+}