summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-09-17 19:24:06 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-09-17 19:24:06 +0200
commit1843e0bbb533a8fd438c31f6dc292dba9065be43 (patch)
treecf1abd01c9f4f42907e90ebcf6690244f6465073 /facetracknoir
parent6f7bff0e7465b2af3247f606db714e7fe4650a42 (diff)
main: Enable X11 threads the idiomatic way
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/main.cpp11
1 files changed, 5 insertions, 6 deletions
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();