diff mbox series

[v4l-utils,v1,08/11] qv4l2: fix Qt6 compile (no matching function for call to QString::split(QRegExp))

Message ID 20230415201056.31080-8-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/general-tab.cpp:2396:69: error: no matching function for call to ‘QString::split(QRegExp)’
   2396 |                         QStringList devAddr = QString(devname).split(QRegExp("[:,]"));
        |                                               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 utils/qv4l2/general-tab.cpp | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 8bb03b59..ffa44eca 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -2393,8 +2393,14 @@  int GeneralTab::checkMatchAudioDevice(void *md, const char *vid, enum device_typ
 
 	while ((devname = get_associated_device(md, devname, type, vid, dtype)) != NULL) {
 		if (type == MEDIA_SND_CAP) {
+#if QT_VERSION < 0x060000
 			QStringList devAddr = QString(devname).split(QRegExp("[:,]"));
 			return devAddr.value(1).toInt();
+#else
+			QRegExp rx("[:,]");
+			rx.indexIn(devname);
+			return rx.cap(1).toInt();
+#endif
 		}
 	}
 	return -1;