mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-18 20:50:09 +08:00
fix qr code crash
This commit is contained in:
parent
1fe253bce2
commit
060a735716
9
3rdparty/QrDecoder.cpp
vendored
9
3rdparty/QrDecoder.cpp
vendored
@ -1,6 +1,9 @@
|
|||||||
#include "QrDecoder.h"
|
#include "QrDecoder.h"
|
||||||
|
|
||||||
#include "quirc/quirc.h"
|
#include "quirc/quirc.h"
|
||||||
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
#include "quirc/quirc_internal.h"
|
||||||
|
|
||||||
QrDecoder::QrDecoder()
|
QrDecoder::QrDecoder()
|
||||||
: m_qr(quirc_new())
|
: m_qr(quirc_new())
|
||||||
@ -30,11 +33,7 @@ QVector<QString> QrDecoder::decode(const QImage &image)
|
|||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
std::copy(image.constBits(), image.constBits() + image.width()*image.height(), rawImage);
|
||||||
std::copy(image.constBits(), image.constBits() + image.sizeInBytes(), rawImage);
|
|
||||||
#else
|
|
||||||
std::copy(image.constBits(), image.constBits() + image.byteCount(), rawImage);
|
|
||||||
#endif
|
|
||||||
quirc_end(m_qr);
|
quirc_end(m_qr);
|
||||||
|
|
||||||
const int count = quirc_count(m_qr);
|
const int count = quirc_count(m_qr);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user