equal
deleted
inserted
replaced
17 */ |
17 */ |
18 #include <stdio.h> |
18 #include <stdio.h> |
19 |
19 |
20 #include <QApplication> |
20 #include <QApplication> |
21 #include <QThread> |
21 #include <QThread> |
|
22 #include <QMainWindow> |
22 |
23 |
23 #include <stdlib.h> |
24 #include <stdlib.h> |
24 #include <signal.h> |
25 #include <signal.h> |
25 #include <X11/Xlib.h> |
26 #include <X11/Xlib.h> |
26 #include <spnav.h> |
27 #include <spnav.h> |
32 setlocale(LC_ALL, ""); |
33 setlocale(LC_ALL, ""); |
33 QApplication app(argc, argv); |
34 QApplication app(argc, argv); |
34 |
35 |
35 SpacenavReceiver t; |
36 SpacenavReceiver t; |
36 t.start(); |
37 t.start(); |
37 |
38 |
38 // SpacenavWindow w; |
39 // QMainWindow w; |
39 // w.show(); |
40 // w.show(); |
40 |
41 |
41 return app.exec(); |
42 int qtResultCode = app.exec(); |
|
43 |
|
44 if (t.isRunning()) { |
|
45 std::wcerr << L"Background RelationalReader thread is still running → terminate()" << std::endl; |
|
46 t.terminate(); |
|
47 std::wcerr << L"Background RelationalReader thread was terminated → wait()" << std::endl; |
|
48 t.wait(); |
|
49 std::wcerr << L"Background RelationalReader thread wait() finished" << std::endl; |
|
50 } |
|
51 |
|
52 return qtResultCode; |
42 } |
53 } |