diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-17 19:24:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-17 19:24:06 +0200 |
commit | 1843e0bbb533a8fd438c31f6dc292dba9065be43 (patch) | |
tree | cf1abd01c9f4f42907e90ebcf6690244f6465073 | |
parent | 6f7bff0e7465b2af3247f606db714e7fe4650a42 (diff) |
main: Enable X11 threads the idiomatic way
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | facetracknoir/main.cpp | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a0207df4..bc734e43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -536,8 +536,6 @@ endif() winmm uuid ) - else() - target_link_libraries(opentrack X11) endif() if(MSVC) SET_TARGET_PROPERTIES(opentrack PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup") diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 25da2961..78ea9aea 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -33,24 +33,23 @@ #if defined(_WIN32) # include <windows.h> //#pragma comment(linker, "/SUBSYSTEM:console /ENTRY:mainCRTStartup") -#elif defined(Q_OS_UNIX) -#include <X11/Xlib.h> #endif int main(int argc, char** argv) { -#if defined(Q_WS_X11) - XInitThreads(); -#endif + QApplication::setAttribute(Qt::AA_X11InitThreads, true); + QApplication app(argc, argv); + QFont font; font.setFamily(font.defaultFamily()); font.setPointSize(9); font.setStyleStrategy(QFont::PreferAntialias); app.setFont(font); - FaceTrackNoIR w; + FaceTrackNoIR w; QDesktopWidget desktop; + w.move(desktop.screenGeometry().width()/2-w.width()/2, 100); w.show(); qApp->exec(); |