当前位置:网站首页>qt使用QZxing生成二维码
qt使用QZxing生成二维码
2022-07-03 15:15:00 【Happinessคิดถึง】
**
更新时间:2022-06-21
**
二维码又称二维条码,常见的二维码为QR Code,QR全称Quick Response,是一个近几年来移动设备上超流行的一种编码方式,它比传统的Bar Code条形码能存更多的信息,也能表示更多的数据类型。
二维条码/二维码(2-dimensional bar code)是用某种特定的几何图形按一定规律在平面(二维方向上)分布的、黑白相间的、记录数据符号信息的图形;在代码编制上巧妙地利用构成计算机内部逻辑基础的“0”、“1”比特流的概念,使用若干个与二进制相对应的几何形体来表示文字数值信息,通过图象输入设备或光电扫描设备自动识读以实现信息自动处理:它具有条码技术的一些共性:每种码制有其特定的字符集;每个字符占有一定的宽度;具有一定的校验功能等。同时还具有对不同行的信息自动识别功能、及处理图形旋转变化点。
常应用于:
●信息获取(名片、地图、WIFI密码、资料)
●网站跳转(跳转到微博、手机网站、网站)
●广告推送(用户扫码,直接浏览商家推送的视频、音频广告)
●手机电商(用户扫码、手机直接购物下单)
●防伪溯源(用户扫码、即可查看生产地;同时后台可以获取最终消费地)
●优惠促销(用户扫码,下载电子优惠券,抽奖)
●会员管理(用户手机上获取电子会员信息、VIP服务)
●手机支付(扫描商品二维码,通过银行或第三方支付提供的手机端通道完成支付)
●账号登录(扫描二维码进行各个网站或软件的登录)
参考:
qt生成二维码
qzxing下载地址:
https://github.com/ftylitak/qzxing
下载后添加scr文件
因为源码都在这个文件里面,所以导入这个文件即可。
pro文件添加pri文件。
include(qzxing/qzxing.pri)
这里我把src文件名改为哦了qzxing
二维码使用-编码和解码
添加头文件。
#include “qzxing/QZXing.h”
代码:
//编码
QImage img = QZXing::encodeData("https://blog.csdn.net/weixin_44353958",QZXing::EncoderFormat_QR_CODE);
ui->label_4->setPixmap(QPixmap::fromImage(img));
ui->label_4->setScaledContents(true);//自适应
//解码
// QZXing decoder;
// //mandatory settings
// decoder.setDecoder( QZXing::DecoderFormat_QR_CODE | QZXing::DecoderFormat_EAN_13 );
// //optional settings
// //decoder.setSourceFilterType(QZXing::SourceFilter_ImageNormal | QZXing::SourceFilter_ImageInverted);
// decoder.setSourceFilterType(QZXing::SourceFilter_ImageNormal);
// decoder.setTryHarderBehaviour(QZXing::TryHarderBehaviour_ThoroughScanning |
// QZXing::TryHarderBehaviour_Rotate);
// //trigger decode
// QString result = decoder.decodeImage(img);
// qDebug()<<"result"<<result;
边栏推荐
- Construction of operation and maintenance system
- Redis lock Optimization Practice issued by gaobingfa
- Idea does not specify an output path for the module
- Neon global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Kubernetes 进阶训练营 Pod基础
- Nppexec get process return code
- Mysql报错:[ERROR] mysqld: File ‘./mysql-bin.010228‘ not found (Errcode: 2 “No such file or directory“)
- Global and Chinese markets of AC electromechanical relays 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of trimethylamine 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
Chapter 04_ Logical architecture
高并发下之redis锁优化实战
运维体系的构建
Matplotlib drawing label cannot display Chinese problems
Introduction to redis master-slave, sentinel and cluster mode
Yolov5系列(一)——网络可视化工具netron
什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
Final review points of human-computer interaction
How does vs+qt set the software version copyright, obtain the software version and display the version number?
Functional modules and application scenarios covered by the productization of user portraits
随机推荐
官网MapReduce实例代码详细批注
【注意力机制】【首篇ViT】DETR,End-to-End Object Detection with Transformers网络的主要组成是CNN和Transformer
[set theory] inclusion exclusion principle (complex example)
XWiki安装使用技巧
Finally, someone explained the financial risk management clearly
什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
redis单线程问题强制梳理门外汉扫盲
[Yu Yue education] scientific computing and MATLAB language reference materials of Central South University
Kubernetes帶你從頭到尾捋一遍
Influxdb2 sources add data sources
Halcon与Winform学习第二节
Composite type (custom type)
视觉上位系统设计开发(halcon-winform)
北京共有产权房出租新规实施的租赁案例
Global and Chinese market of trimethylamine 2022-2028: Research Report on technology, participants, trends, market size and share
Halcon与Winform学习第一节
Enable multi-threaded download of chrome and edge browsers
视觉上位系统设计开发(halcon-winform)-1.流程节点设计
基础SQL教程
Troubleshooting method of CPU surge