当前位置:网站首页>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;

边栏推荐
- Global and Chinese markets for sterile packaging 2022-2028: Research Report on technology, participants, trends, market size and share
- Byte practice surface longitude
- . Net six design principles personal vernacular understanding, please correct if there is any error
- 视觉上位系统设计开发(halcon-winform)-1.流程节点设计
- Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
- The first character of leetcode sword offer that only appears once (12)
- 【可能是全中文网最全】pushgateway入门笔记
- XWiki安装使用技巧
- Introduction to redis master-slave, sentinel and cluster mode
- Using notepad++ to build an arbitrary language development environment
猜你喜欢

高并发下之redis锁优化实战

什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用

百度智能云助力石嘴山市升级“互联网+养老服务”智慧康养新模式

4-29——4.32

B2020 分糖果

B2020 points candy

【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现

Zero copy underlying analysis

Kubernetes带你从头到尾捋一遍

Concurrency-01-create thread, sleep, yield, wait, join, interrupt, thread state, synchronized, park, reentrantlock
随机推荐
【pytorch学习笔记】Transforms
Tencent internship interview sorting
[set theory] inclusion exclusion principle (complex example)
什么是Label encoding?one-hot encoding ,label encoding两种编码该如何区分和使用?
"Seven weapons" in the "treasure chest" of machine learning: Zhou Zhihua leads the publication of the new book "machine learning theory guide"
Global and Chinese markets for sterile packaging 2022-2028: Research Report on technology, participants, trends, market size and share
Use of Tex editor
[wechat applet] wxss template style
视觉上位系统设计开发(halcon-winform)-5.相机
Concurrency-01-create thread, sleep, yield, wait, join, interrupt, thread state, synchronized, park, reentrantlock
[pytorch learning notes] datasets and dataloaders
5.2-5.3
Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
Pytoch deep learning and target detection practice notes
Kubernetes will show you from beginning to end
Besides lying flat, what else can a 27 year old do in life?
Introduction to redis master-slave, sentinel and cluster mode
Global and Chinese market of marketing automation 2022-2028: Research Report on technology, participants, trends, market size and share
Kubernetes - YAML文件解读
Yolov5 advanced nine target tracking example 1