summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-21 19:42:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-21 21:41:36 +0200
commit8e2aba0a468c189a6eb733fe3fab5b7889abb7ba (patch)
tree9588045fdf1d3ffba2ab99786d8048af78e8a18c
parent27109d3fd204f971a920cb034a5499bdb6ebb81b (diff)
use more savory UI style on win32
-rw-r--r--facetracknoir/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index 7462f8c2..aa33522d 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -1,11 +1,33 @@
#include "facetracknoir.h"
#include <QApplication>
+#include <QStyleFactory>
+#include <QStringList>
#include <memory>
int main(int argc, char** argv)
{
+ // workaround QTBUG-38598
+ QCoreApplication::addLibraryPath(".");
+
+ // qt5 designer-made controls look like shit on 'doze -sh 20140921
+#ifdef _WIN32
+ {
+ const QStringList preferred { "fusion", "windowsvista", "jazzbands'-marijuana", "macintosh", "windowsxp" };
+ for (const auto& style_name : preferred)
+ {
+ QStyle* s = QStyleFactory::create(style_name);
+ if (s)
+ {
+ QApplication::setStyle(s);
+ break;
+ }
+ }
+ }
+#endif
+
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
QApplication app(argc, argv);
+
auto w = std::make_shared<FaceTrackNoIR>();
w->show();