diff mbox series

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

Message ID 20231116122402.28730-4-ps.report@gmx.net
State New
Headers show
Series [v4l-utils,v1,1/4] qv4l2: remove unused local variables 'QString what' | expand

Commit Message

Peter Seiderer Nov. 16, 2023, 12:24 p.m. UTC
- 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@gmx.net>
---
 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 mbox series

Patch

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