diff options
Diffstat (limited to 'facetracknoir/main.cpp')
-rw-r--r-- | facetracknoir/main.cpp | 77 |
1 files changed, 21 insertions, 56 deletions
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 3143a093..aa33522d 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -1,72 +1,37 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of the some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* Homepage * -* * -* 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 the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see <http://www.gnu.org/licenses/>. * -*********************************************************************************/ - #include "facetracknoir.h" -#include "tracker.h" #include <QApplication> -#include <QDesktopWidget> -#include <QDebug> -#include <QList> -#include <QDir> +#include <QStyleFactory> #include <QStringList> #include <memory> -#if defined(_WIN32) && defined(_MSC_VER) -# include <windows.h> -# ifdef OPENTRACK_BREAKPAD -# include <exception_handler.h> -using namespace google_breakpad; -bool dumpCallback(const wchar_t* dump_path, - const wchar_t* minidump_id, - void* context, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion, - bool succeeded) -{ - MessageBoxA(GetDesktopWindow(), - "Generating crash dump!\r\n" - "Please send the .dmp file to <sthalik@misaki.pl> to help us improve the code.", - "opentrack crashed :(", - MB_OK | MB_ICONERROR); - return succeeded; -} - -# endif -#endif - int main(int argc, char** argv) { -#if defined(OPENTRACK_BREAKPAD) && defined(_MSC_VER) - auto handler = new ExceptionHandler(L".", nullptr, dumpCallback, nullptr, -1); + // 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(); app.exec(); - return 0; + return 0; } - |