From 9a2f88779064b46ae097a354c97d657901f47d01 Mon Sep 17 00:00:00 2001
From: Melvin Keskin <melvo@olomono.de>
Date: Fri, 18 Feb 2022 10:48:46 +0100
Subject: [PATCH] QrCodeDecoder: Replace deprecated 'BarcodeFormat::QR_CODE'
with 'BarcodeFormat::QRCode'
---
src/QrCodeDecoder.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/QrCodeDecoder.cpp b/src/QrCodeDecoder.cpp
index a84978f..a7b0cf5 100644
--- a/src/QrCodeDecoder.cpp
+++ b/src/QrCodeDecoder.cpp
@@ -60,7 +60,11 @@ void QrCodeDecoder::decodeImage(const QImage &image)
{
// Advise the decoder to check for QR codes and to try decoding rotated versions of the image.
#if ZXING_VERSION >= QT_VERSION_CHECK(1, 1, 0)
+# if ZXING_VERSION >= QT_VERSION_CHECK(1, 1, 1)
+ const auto decodeHints = DecodeHints().setFormats(BarcodeFormat::QRCode);
+# else
const auto decodeHints = DecodeHints().setFormats(BarcodeFormat::QR_CODE);
+# endif
const auto result = ReadBarcode({image.bits(), image.width(), image.height(), ZXing::ImageFormat::Lum, image.bytesPerLine()}, decodeHints);
#else
const auto decodeHints =
--
2.39.1