• 大小: 4.74MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-19
  • 语言: 其他
  • 标签: C++  QT  

资源简介

使用QZXing库实现二维码的生成与解析 压缩包里包含QZXing库,同时可以识别中文

资源截图

代码片段和文件信息

#include 

#include “LHCQZXingQRCode.h“
#include “QZXing/QZXing.h“

LHCQZXingQRCode::LHCQZXingQRCode(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
ui.widget->setAutoFillBackground(true);
}

void LHCQZXingQRCode::on_pushButton_clicked()
{
//文字为中文时,不包含换行符,扫描为乱码;
QString lineText = ui.lineEdit->text() + “\n“;
QZXing decoder;
QImage decoderImage = decoder.encodeData(lineText);
QPalette palette;
palette.setBrush(this->backgroundRole() QBrush(decoderImage));
ui.widget->setPalette(palette);
}

void LHCQZXingQRCode::on_pushButton_2_clicked()
{
QString file_path = QFileDialog::getOpenFileName(this);

QImage imageToDecode(file_path);
QZXing decoder;
decoder.setDecoder(QZXing::DecoderFormat_QR_CODE | QZXing::DecoderFormat_EAN_13);
QString result = decoder.decodeImage(imageToDecode);
ui.lineEdit_2->setText(result);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     52736  2019-04-09 14:04  QZXingCodeATest\LHCQZXingQRCode\.vs\LHCQZXingQRCode\v14\.suo

     文件       3444  2019-04-09 10:43  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\1554777836.png

     文件       3545  2019-04-09 13:52  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\1554789159.png

     文件       3910  2019-04-09 13:53  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\1554789186.png

     文件       3842  2019-04-09 11:44  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\GeneratedFiles\Debug\moc_LHCQZXingQRCode.cpp

     文件      26228  2019-04-09 11:13  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\GeneratedFiles\Debug\moc_QZXing.cpp

     文件       1445  2019-04-09 11:13  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\GeneratedFiles\qrc_LHCQZXingQRCode.cpp

     文件       7079  2019-04-09 13:47  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\GeneratedFiles\ui_LHCQZXingQRCode.h

     文件        912  2019-04-09 14:02  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.cpp

     文件        332  2019-04-09 11:42  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.h

     文件         75  2019-04-08 15:24  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.qrc

     文件       4374  2019-04-09 13:43  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.ui

     文件       9876  2019-04-09 11:39  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.vcxproj

     文件       2345  2019-04-09 11:39  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.vcxproj.filters

     文件        639  2019-04-09 14:00  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\LHCQZXingQRCode.vcxproj.user

     文件        193  2019-04-09 13:31  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\main.cpp

    ..A..H.     23552  2019-04-08 19:05  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\QZXing\.vs\QZXing\v14\.suo

     文件       7528  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\QZXing\QZXing.h

     文件        833  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\QZXing\QZXing_global.h

     文件    1944576  2019-04-09 10:03  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\QZXing\x64_QZXing2.dll

     文件      13594  2019-04-09 10:03  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\QZXing\x64_QZXing2.lib

     文件    1944576  2019-04-09 10:03  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\x64_QZXing2.dll

     文件      13594  2019-04-09 10:03  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\x64_QZXing2.lib

     文件   10424320  2019-04-09 10:03  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\x64_QZXing2.pdb

     文件       1357  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\aztec\AztecDetectorResult.h

     文件       1314  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\aztec\AztecReader.h

     文件       1859  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\aztec\decoder\Decoder.h

     文件       2898  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\aztec\detector\Detector.h

     文件       1356  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\BarcodeFormat.h

     文件       1332  2019-04-03 17:19  QZXingCodeATest\LHCQZXingQRCode\LHCQZXingQRCode\zxing\Binarizer.h

............此处省略674个文件信息

评论

共有 条评论