Allow QR code generation from binary data

This commit is contained in:
Berk Demirkır
2025-06-05 18:38:45 +03:00
parent 024772ef94
commit 58633d8cd0
2 changed files with 34 additions and 0 deletions
+16
View File
@@ -58,6 +58,22 @@ public:
qrcodegen::QrCode::Ecc errorCorrection
= qrcodegen::QrCode::Ecc::MEDIUM);
/**
* @brief Generates a QR code from the given data and error correction level.
* @param data The QByteArray containing the data to encode in the QR code.
* @param size The desired width/height of the generated image (default: 500).
* @param borderSize The desired border width of the generated image (default:
* 1).
* @param errorCorrection The desired error correction level (default:
* qrcodegen::QrCode::Ecc::MEDIUM).
*
* @return QImage containing the generated QR code.
*/
QImage generateQr(const QByteArray &data, const quint16 size = 1000,
const quint16 borderSize = 1,
qrcodegen::QrCode::Ecc errorCorrection
= qrcodegen::QrCode::Ecc::MEDIUM);
/**
* @brief Generates a QR code from the given data and error correction level.
* @param data The QString containing the data to encode in the QR code.