mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 18:34:25 +01:00
Bugfix: QR code generation was case insensitive
Also changed Qstring back to std::string
This commit is contained in:
parent
2ab091679f
commit
a45fc4ca33
@ -14,7 +14,7 @@ QRWidget::QRWidget(QWidget* parent) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRWidget::setQRData(const QString &data)
|
void QRWidget::setQRData(const std::string &data)
|
||||||
{
|
{
|
||||||
_data = data;
|
_data = data;
|
||||||
update();
|
update();
|
||||||
@ -25,7 +25,7 @@ void QRWidget::paintEvent(QPaintEvent*)
|
|||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
std::unique_ptr<QRcode, void(*)(QRcode*)> qr(
|
std::unique_ptr<QRcode, void(*)(QRcode*)> qr(
|
||||||
QRcode_encodeString(_data.toStdString().c_str(), 1, QR_ECLEVEL_L, QR_MODE_8, 0),
|
QRcode_encodeString(_data.c_str(), 1, QR_ECLEVEL_L, QR_MODE_8, 1),
|
||||||
[] (QRcode* ptr) {
|
[] (QRcode* ptr) {
|
||||||
if (ptr)
|
if (ptr)
|
||||||
QRcode_free(ptr);
|
QRcode_free(ptr);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef QRWIDGET_H
|
#ifndef QRWIDGET_H
|
||||||
#define QRWIDGET_H
|
#define QRWIDGET_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QRWidget : public QWidget
|
class QRWidget : public QWidget
|
||||||
@ -9,10 +11,10 @@ class QRWidget : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QRWidget(QWidget *parent = nullptr);
|
explicit QRWidget(QWidget *parent = nullptr);
|
||||||
void setQRData(const QString &data);
|
void setQRData(const std::string &data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _data;
|
std::string _data;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *);
|
void paintEvent(QPaintEvent *);
|
||||||
|
Loading…
Reference in New Issue
Block a user