diff mbox series

[v4l-utils,v1,09/11] qv4l2: fix Qt6 warnings (QKeyCombination operator+ is deprecated)

Message ID 20230415201056.31080-9-ps.report@gmx.net
State New
Headers show
Series [v4l-utils,v1,01/11] qv4l2: remove leagcy alsa_stream.h include (ENABLE_ALSA protected) | expand

Commit Message

Peter Seiderer April 15, 2023, 8:10 p.m. UTC
Fixes:

  ../qv4l2/capture-win.cpp:49:57: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
     49 |         m_hotkeyScaleReset = new QShortcut(Qt::CTRL+Qt::Key_F, this);
        |                                                         ^~~~~

  ../qv4l2/capture-win.cpp:69:35: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
     69 |         shortcuts << Qt::CTRL+Qt::Key_W;
        |                                   ^~~~~

  ../qv4l2/qv4l2.cpp:135:43: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    135 |         openAct->setShortcut(Qt::CTRL+Qt::Key_O);
        |                                           ^~~~~

  ../qv4l2/qv4l2.cpp:140:46: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    140 |         openRawAct->setShortcut(Qt::CTRL+Qt::Key_R);
        |                                              ^~~~~

  ../qv4l2/qv4l2.cpp:147:49: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    147 |         m_capStartAct->setShortcut(Qt::CTRL+Qt::Key_V);
        |                                                 ^~~~~

  ../qv4l2/qv4l2.cpp:172:44: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    172 |         closeAct->setShortcut(Qt::CTRL+Qt::Key_W);
        |                                            ^~~~~

  ../qv4l2/qv4l2.cpp:182:43: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    182 |         quitAct->setShortcut(Qt::CTRL+Qt::Key_Q);
        |                                           ^~~~~

  ../qv4l2/qv4l2.cpp:212:53: warning: ‘constexpr QKeyCombination operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations]
    212 |         m_resetScalingAct->setShortcut(Qt::CTRL+Qt::Key_F);
        |                                                     ^~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 utils/qv4l2/capture-win.cpp |  4 ++--
 utils/qv4l2/qv4l2.cpp       | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/utils/qv4l2/capture-win.cpp b/utils/qv4l2/capture-win.cpp
index ef33a91b..c184381f 100644
--- a/utils/qv4l2/capture-win.cpp
+++ b/utils/qv4l2/capture-win.cpp
@@ -46,7 +46,7 @@  CaptureWin::CaptureWin(ApplicationWindow *aw) :
 	m_appWin(aw)
 {
 	setWindowTitle("V4L2 Capture");
-	m_hotkeyScaleReset = new QShortcut(Qt::CTRL+Qt::Key_F, this);
+	m_hotkeyScaleReset = new QShortcut(Qt::CTRL|Qt::Key_F, this);
 	connect(m_hotkeyScaleReset, SIGNAL(activated()), this, SLOT(resetSize()));
 	connect(aw->m_resetScalingAct, SIGNAL(triggered()), this, SLOT(resetSize()));
 	m_hotkeyExitFullscreen = new QShortcut(Qt::Key_Escape, this);
@@ -66,7 +66,7 @@  CaptureWin::CaptureWin(ApplicationWindow *aw) :
 	m_closeWindowAct->setStatusTip("Close");
 	QList<QKeySequence> shortcuts;
 	// More standard close window shortcut
-	shortcuts << Qt::CTRL+Qt::Key_W;
+	shortcuts << (Qt::CTRL|Qt::Key_W);
 	// Historic qv4l2 shortcut
 	shortcuts << Qt::Key_Q;
 	m_closeWindowAct->setShortcuts(shortcuts);
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index e49a4599..bcba88f5 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -132,19 +132,19 @@  ApplicationWindow::ApplicationWindow() :
 
 	QAction *openAct = new QAction(QIcon(":/fileopen.png"), "&Open Device", this);
 	openAct->setStatusTip("Open a v4l device, use libv4l2 wrapper if possible");
-	openAct->setShortcut(Qt::CTRL+Qt::Key_O);
+	openAct->setShortcut(Qt::CTRL|Qt::Key_O);
 	connect(openAct, SIGNAL(triggered()), this, SLOT(opendev()));
 
 	QAction *openRawAct = new QAction(QIcon(":/fileopen.png"), "Open &Raw Device", this);
 	openRawAct->setStatusTip("Open a v4l device without using the libv4l2 wrapper");
-	openRawAct->setShortcut(Qt::CTRL+Qt::Key_R);
+	openRawAct->setShortcut(Qt::CTRL|Qt::Key_R);
 	connect(openRawAct, SIGNAL(triggered()), this, SLOT(openrawdev()));
 
 	m_capStartAct = new QAction(QIcon(":/start.png"), "Start &Capturing", this);
 	m_capStartAct->setStatusTip("Start capturing");
 	m_capStartAct->setCheckable(true);
 	m_capStartAct->setDisabled(true);
-	m_capStartAct->setShortcut(Qt::CTRL+Qt::Key_V);
+	m_capStartAct->setShortcut(Qt::CTRL|Qt::Key_V);
 	connect(m_capStartAct, SIGNAL(toggled(bool)), this, SLOT(capStart(bool)));
 
 	m_capStepAct = new QAction(QIcon(":/step.png"), "Single Step", this);
@@ -169,7 +169,7 @@  ApplicationWindow::ApplicationWindow() :
 
 	QAction *closeAct = new QAction(QIcon(":/fileclose.png"), "&Close Device", this);
 	closeAct->setStatusTip("Close");
-	closeAct->setShortcut(Qt::CTRL+Qt::Key_W);
+	closeAct->setShortcut(Qt::CTRL|Qt::Key_W);
 	connect(closeAct, SIGNAL(triggered()), this, SLOT(closeDevice()));
 
 	QAction *traceAct = new QAction("&Trace IOCTLs", this);
@@ -179,7 +179,7 @@  ApplicationWindow::ApplicationWindow() :
 
 	QAction *quitAct = new QAction(QIcon(":/exit.png"), "&Quit", this);
 	quitAct->setStatusTip("Exit the application");
-	quitAct->setShortcut(Qt::CTRL+Qt::Key_Q);
+	quitAct->setShortcut(Qt::CTRL|Qt::Key_Q);
 	connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));
 
 	QMenu *fileMenu = menuBar()->addMenu("&File");
@@ -209,7 +209,7 @@  ApplicationWindow::ApplicationWindow() :
 
 	m_resetScalingAct = new QAction("Resize to &Frame Size", this);
 	m_resetScalingAct->setStatusTip("Resizes the capture window to match frame size");
-	m_resetScalingAct->setShortcut(Qt::CTRL+Qt::Key_F);
+	m_resetScalingAct->setShortcut(Qt::CTRL|Qt::Key_F);
 
 	m_overrideColorspace = -1;
 	QMenu *menu = new QMenu("Override Colorspace");