diff options
author | DaMichel <mw.pub@welter-4d.de> | 2016-08-07 09:59:32 +0200 |
---|---|---|
committer | DaMichel <mw.pub@welter-4d.de> | 2016-08-07 09:59:32 +0200 |
commit | 9c34be2427a483d3bf5f115eac28dec2716461f2 (patch) | |
tree | 59310c4477840345b53c671b5b5194f7f8c131bb | |
parent | 16d7bb4d8c051d3196456ec89550c637e4d84677 (diff) |
Fix trivial build errors on linux. Also support Qt 5.5.
-rw-r--r-- | cv/camera-dialog.cpp | 2 | ||||
-rw-r--r-- | cv/camera-dialog.hpp | 2 | ||||
-rw-r--r-- | gui/main.cpp | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/cv/camera-dialog.cpp b/cv/camera-dialog.cpp index 05161cb1..f2cdf9db 100644 --- a/cv/camera-dialog.cpp +++ b/cv/camera-dialog.cpp @@ -20,12 +20,14 @@ void camera_dialog::maybe_grab_frame(cv::VideoCapture& cap) } } +#ifdef _WIN32 void camera_dialog::init_com_threading() { HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if (FAILED(hr)) qDebug() << "failed CoInitializeEx" << hr << "code" << GetLastError(); } +#endif camera_dialog::~camera_dialog() {} diff --git a/cv/camera-dialog.hpp b/cv/camera-dialog.hpp index 08462e92..15ae2bc9 100644 --- a/cv/camera-dialog.hpp +++ b/cv/camera-dialog.hpp @@ -16,13 +16,13 @@ #endif #ifdef _WIN32 -# include <opencv2/videoio.hpp> # include <QTimer> # include <objbase.h> # include <winerror.h> # include <windows.h> #endif +#include <opencv2/videoio.hpp> #include <QMutex> class camera_dialog diff --git a/gui/main.cpp b/gui/main.cpp index e708dc9d..c07a65ac 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -116,7 +116,9 @@ int main(int argc, char** argv) QCoreApplication::addLibraryPath("."); #endif +#if QT_VERSION >= 0x050600 // flag introduced in QT 5.6. It is non-essential so might as well allow compilation on older systems. QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif QApplication::setAttribute(Qt::AA_X11InitThreads, true); QApplication app(argc, argv); |