[PATCH v4l-utils v1 4/4] qvidcap: enable Qt6 compile with Qt OpenGL support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



- update qmake project file for Qt6 (openglwidgets)
- fix includes for Qt6 (QOpenGLShaderProgram instead of
  QtGui/QOpenGLShaderProgram and  QOpenGLPaintDevice instead
  of QtGui/QOpenGLPaintDevice)

Signed-off-by: Peter Seiderer <ps.report@xxxxxxx>
---
 utils/qvidcap/capture.cpp | 4 ++++
 utils/qvidcap/capture.h   | 4 ++++
 utils/qvidcap/paint.cpp   | 4 ++++
 utils/qvidcap/qvidcap.pro | 1 +
 4 files changed, 13 insertions(+)

diff --git a/utils/qvidcap/capture.cpp b/utils/qvidcap/capture.cpp
index 0b4c4115..1e3597b0 100644
--- a/utils/qvidcap/capture.cpp
+++ b/utils/qvidcap/capture.cpp
@@ -13,7 +13,11 @@
 #include <QtCore/QTextStream>
 #include <QtCore/QCoreApplication>
 #include <QtGui/QOpenGLContext>
+#if QT_VERSION < 0x060000
 #include <QtGui/QOpenGLPaintDevice>
+#else
+#include <QOpenGLPaintDevice>
+#endif
 #include <QtGui/QContextMenuEvent>
 #include <QtGui/QKeyEvent>
 #include <QtGui/QPainter>
diff --git a/utils/qvidcap/capture.h b/utils/qvidcap/capture.h
index 37f5bfc5..8ebe76a9 100644
--- a/utils/qvidcap/capture.h
+++ b/utils/qvidcap/capture.h
@@ -16,7 +16,11 @@
 #include <QAction>
 #include <QActionGroup>
 #include <QScrollArea>
+#if QT_VERSION < 0x060000
 #include <QtGui/QOpenGLShaderProgram>
+#else
+#include <QOpenGLShaderProgram>
+#endif
 
 #include "qvidcap.h"
 
diff --git a/utils/qvidcap/paint.cpp b/utils/qvidcap/paint.cpp
index c5aadb09..0246de60 100644
--- a/utils/qvidcap/paint.cpp
+++ b/utils/qvidcap/paint.cpp
@@ -13,7 +13,11 @@
 #include <QtCore/QTextStream>
 #include <QtCore/QCoreApplication>
 #include <QtGui/QOpenGLContext>
+#if QT_VERSION < 0x060000
 #include <QtGui/QOpenGLPaintDevice>
+#else
+#include <QOpenGLPaintDevice>
+#endif
 #include <QtGui/QContextMenuEvent>
 #include <QtGui/QKeyEvent>
 #include <QtGui/QPainter>
diff --git a/utils/qvidcap/qvidcap.pro b/utils/qvidcap/qvidcap.pro
index cf7d3ca5..d08f0059 100644
--- a/utils/qvidcap/qvidcap.pro
+++ b/utils/qvidcap/qvidcap.pro
@@ -7,6 +7,7 @@ INCLUDEPATH += . ../libv4l2util ../../lib/include ../../include
 CONFIG += debug
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+greaterThan(QT_MAJOR_VERSION, 5): QT += openglwidgets
 
 # adjust to your local meson build path
 MESON_BUILD_PATH = $$PWD/build-meson
-- 
2.42.1


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux