src/spacenav-demo-qt.cpp
branchv_0
changeset 4 1383ad1c4f57
parent 2 21b0b2b0547e
child 6 49560660d230
--- a/src/spacenav-demo-qt.cpp	Wed Mar 06 23:19:10 2019 +0100
+++ b/src/spacenav-demo-qt.cpp	Thu Mar 07 14:55:56 2019 +0100
@@ -1,6 +1,6 @@
 /**
  * Spacenav Demo Qt
- * Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
+ * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,26 +19,22 @@
 
 #include <QApplication>
 #include <QThread>
-#include <QMainWindow>
-
-#include <stdlib.h>
-#include <signal.h>
-#include <X11/Xlib.h>
-#include <spnav.h>
 
 #include "SpacenavReceiver.h"
-//#include "SpacenavWindow.h"
+#include "SpacenavWindow.h"
 
 int main(int argc, char**argv) {
 	setlocale(LC_ALL, "");
 	QApplication app(argc, argv);
 
 	SpacenavReceiver t;
-	t.start();
+
+	SpacenavWindow w;
+	w.show();
 
-	// QMainWindow w;
-	// w.show();
+	QObject::connect(&t, &SpacenavReceiver::spacenavEvent, &w, &SpacenavWindow::spacenavEvent, Qt::ConnectionType::QueuedConnection);
 
+	t.start();
 	int qtResultCode = app.exec();
 
 	if (t.isRunning()) {