娣什么意思| 物欲横流什么意思| 插队是什么意思| 性格内敛是什么意思| 十二生肖各代表什么花| 坐南朝北是什么意思| 虐猫是什么意思| 大宗物品是什么意思| 高血压是什么原因引起的| 血液粘稠会有什么症状| 正月十八是什么星座| 明天我要离开是什么歌| 血常规一般查什么病| 小孩晚上睡觉磨牙是什么原因| 湿气重的人喝四物汤会有什么| 08年属什么生肖| 林俊杰为什么不结婚| 常温保存是什么意思| angelababy是什么意思| 白醋洗脸有什么好处| 缺钙查什么化验项目| 系统b超主要检查什么| 铜罗是什么生肖| 殊途同归什么意思| 心有不甘是什么意思| covu药片是什么药| 什么是天赋| 配制酒是什么意思| 捉虫是什么意思| 夹层是什么意思| 5月24日是什么星座| 迈之灵治什么病| 什么药不能喝酒| 红薯什么时候掐尖| 熟视无睹什么意思| 前列腺钙化灶是什么病| 飞机加什么油| 2008年是属什么| 15岁可以做什么兼职| 门面是什么意思| 爱被蚊子咬是什么原因| 腰花是什么| 胸外科主要看什么病| 果脯是什么东西| 水逆是什么| 晚餐吃什么| 清浅是什么意思| 大惊小怪是什么意思| 吃什么利尿消肿| 室性早搏是什么意思| 脸色发青是什么原因引起的| 肚子饱胀是什么原因| 条索灶是什么意思| 什么样的女人容易出轨| 二型血糖高吃什么药好| 生殖细胞瘤是什么病| 移植后屁多是什么原因| 溺爱的意思是什么| 为什么会长痘| 淋巴结有什么症状| 宫腔内钙化灶是什么意思| 生态皮是什么材质| 软化耳屎的药水叫什么| 金不换是什么意思| 旭日阳刚为什么不火了| 抱薪救火是什么意思| 一厢情愿是什么生肖| 男性尿黄是什么原因| 白带是绿色的是什么原因| s和m是什么意思| 窦性心律是什么| 何解是什么意思| 六月二十八是什么日子| 缠绵是什么意思| 四月十号是什么星座| 婴儿血小板低是什么原因| 犒劳自己是什么意思| 记忆力不好吃什么| 记忆力减退是什么原因造成的| 喜欢趴着睡是什么原因| 科举制什么时候废除| 腋毛上有白色附着物是什么| 夏天木瓜煲什么汤最好| 肝火胃火旺吃什么药| 人参吃了有什么好处| lsp是什么| ch什么意思| 牛油果吃了有什么好处| 什么叫湿热| 咳嗽有黄痰是什么原因| 麦粒肿吃什么消炎药| 为什么脸上会长痘痘| 嗓子痒痒老想咳嗽是什么原因| 舌头麻木是什么原因引起| 饮料喝多了有什么危害| 什么野菜| 神助攻什么意思| 胃酸反流是什么原因造成| 电镀对人体有什么危害| 吃开心果有什么好处和坏处| 做包子用什么面粉好| 月季花是什么颜色| 气血不足吃什么补得快| 咏字五行属什么| 徐州有什么好吃的| 子宫内膜异位症有什么症状表现| 冬瓜炒什么好吃| 现在什么时辰| 月经推迟量少是什么原因| 硬化症是什么病| 梦见刷牙是什么预兆| 鹦鹉吃什么东西| 为什么喝水血糖也会高| 被蜜蜂蛰了有什么好处| hcho是什么意思| 阿司匹林什么时间吃最好| 昱五行属性是什么| spo2过低是什么意思| 梦见自己怀孕是什么意思| 附件是什么部位| 前列腺实质回声欠均匀什么意思| 植物生长需要什么| 双开是什么意思| 埃及人是什么人种| 精索炎吃什么药最好| 睡眠障碍吃什么药最好| 头发油性大是什么原因| 外感风热是什么意思| 户籍地址是什么| 81年五行属什么| 乳腺结节和乳腺增生有什么区别| hc是胎儿的什么| 丙辰是什么时辰| 切除一侧输卵管对女性有什么影响| 阳上人是什么意思| 逆商是什么| 拜把子是什么意思| 什么人不宜喝咖啡| 唾液是什么| 什么品牌油烟机好| 微循环是什么意思| 什么白酒好喝| 食禄是什么意思| ck香水属于什么档次| ntr是什么意思啊| 鱼生是什么| swisse是什么药| 房速与房颤有什么区别| 技校是什么| 初恋是什么意思| lily是什么花| 香蕉可以做什么美食| 缺血吃什么补血最快| 9月3日是什么纪念日| 吃的多拉的少是什么原因| 爱吃酸的人是什么体质| 什么什么发光| 口腔痛什么原因| 吃什么除体内湿气最快| 指甲有竖纹吃什么药| 高利贷是什么意思| 东星斑为什么这么贵| 夏令时是什么| 苹果什么时候成熟| 嘴角周围长痘痘是什么原因| 脉压是什么意思| 眼白发黄是什么原因| 月什么人什么| 什么为笑| 什么叫造影| 牙龈萎缩是什么样子| 什么是酒糟鼻| 一什么无什么| 殿试是什么意思| 什么药清肺化痰好| 什么食物高蛋白含量高| 辰时是什么时候| 泥腿子是什么意思| 腥是什么意思| 梦见已故朋友什么预兆| 较重闭合性跌打损伤是什么意思| 血小板分布宽度偏低是什么原因| 小孩记忆力差是什么原因| 定妆喷雾什么时候用| 头痛是什么病的前兆| 憔悴是什么意思| 左耳耳鸣是什么原因| 日主是什么意思| 儿童淋巴结肿大挂什么科| 成年人改名字需要什么手续| 海啸是什么| 蟑螂喜欢什么样的环境| 主任是什么意思| 当兵什么时候体检| 黄疸高是什么原因引起的| 糖尿病人吃什么| 山竹什么味道| carol什么意思| 29是什么生肖| 觉的部首是什么偏旁| 家是什么| 砼为什么念hun| b12是什么| 芋头是什么| 风平浪静是什么生肖| 教学相长什么意思| yjs是什么意思| 射手座属于什么星象| 宫腔粘连是什么意思| 别开生面什么意思| 感冒了吃什么食物最好| 英国全称叫什么| 脊柱炎吃什么药效果好| replay是什么牌子| 抽烟为什么会上瘾| 太阳里面有什么| 肝功能挂什么科| 吃青椒有什么好处| 鲈鱼不能和什么一起吃| 小便次数多吃什么药| 赫兹是什么意思| 小孩啃指甲是什么原因| 腹部胀痛什么原因| 女同学过生日送什么礼物比较好| 二重唱是什么意思| 语文是什么| 针眼长什么样| 弧度是什么意思| 烫伤忌口不能吃什么| 十全十美是什么意思| 五岳是什么意思| 拉肚子可以吃什么食物| 呲牙是什么意思| 上海为什么叫上海| 宫颈筛查是什么意思| 湿疹什么样子| 什么人容易得肾结石| 宫高是什么意思| 扛幡是什么意思| 非洲人一日三餐吃什么| 做小吃什么生意最赚钱| 宫外孕什么意思| 脚底疼是什么原因引起的| 左侧脖子疼是什么原因| 胃痛呕吐什么原因| 床塌了有什么预兆| 抽油烟机买什么样的好| 内热是什么原因引起的怎么调理| 三维重建是什么意思| 孕妇晚餐吃什么比较好| 西凤酒什么香型| 缺锌有什么表现和症状| 两情相悦什么意思| 看见蛇有什么预兆| 诈骗是什么意思| 葱长什么样| 女人排卵期什么时候| 儿童嗓子疼吃什么药| 约法三章什么意思| 公立医院是什么意思| 宫颈切片检查是什么| 蜂蜜和柠檬一起喝有什么作用| 十指不沾阳春水是什么意思| 染色体xy代表什么| 百度
Skip to content
Pablo J. Rogina edited this page Nov 15, 2017 · 2 revisions

Welcome to the QZXing wiki!
This is a wrapper library of the C++ part of ?ZXing library.

Getting started

This library is mented to be very simple and will provide as simple as possible the decoding operations. Thus my main purpose is not to support extreme operations and complex techniques that ZXing library does support. Of course, the original ZXing code is still here for everyone interested in using something beyond the already implemented (those of you willing to make more operations available, their code is always welcomed to be merged).

Supported barcode types:

  • UPC-A and UPC-E
  • EAN-8 and EAN-13
  • Code 39
  • Code 93
  • Code 128
  • ITF
  • Codabar
  • RSS-14 (all variants)
  • RSS Expanded (most variants)
  • QR Code
  • Data Matrix
  • Aztec ('beta' quality)
  • PDF 417 ('alpha' quality)

So, if you have a Qt project and your target is to decode a barcode contained in an image, then this is how is done...

Including the library

There are 2 options on how to include/embed the library in your code.

  1. Use the source code of the project. Embed the source code of the project in your project, build it all as one and you are done. For more instructions see here.

In the code

Where the library needs to be used you have to include the header file: #include <qzxing.h>. Now a QZXing object can be created. It is recommended (but not obligatory) to use one instance of it and decode any number of barcodes you decide. The class supports 3 methods:

  • setDecoder(DecoderFormat): DecoderFormat is an enumeration regarding the types of barcodes the decoder will try to identify to each decoding. By default all the types are enabled but hence that it is extra processing. If you want to identify specific barcode types you can disable the other. This will result to faster processing. Conjunctions of more than one types of barcodes are supported using logical OR over the enumeration. For example if we need to support both Qt Codes and EAN 13 we need to call the following:

      QZXing decoder;
      decoder.setDecoder( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 );
    

This enable/disable operation of the decoders can be done any time needed.

  • registerQMLTypes(): If you are planning to use the library in the QML then in the main function you need to call this static function. It will register the QZXing library and make it visible to QML. After that, in the qml file you are planning to use the library you need to write at the top:

      import QZXing 2.x //enter the version of the release
    
  • decodeImage(QImage image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false): the method that initiates the decoding. It is made as a slot for convenience. It is blocking function thus if you need your application to continue without freezing, you can call it to an other thread. Finally return the result of the decoding. It also allows to scale the image before decoding to reduce the image resolution and make the decoding faster. If an error occurred it will return an empty string "".

  • decodeImage(QString imageFilePath, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false): an overloaded version of the deodeImage function. The image is provided as a path to the image file in the local file system.

  • decodeImageQML(QObject*): the method that has to be called from QML to decode an Image Element. By calling this function the decoder will search the whole picture to find something to decode. As argument is used the Image QML element that holds the image that we want to decode. If is needed to decode only a specific part of the image use decodeSubImageQML. Introduced in version V1.2

  • decodeSubImageQML(QObject*, double, double, double, double): the method that has to be called from QML to decode only a portion of an Image Element. First argument is the Image QML element. The rest are as follows: offsetX, offsetY, width, height.

    • offsetX, offsetY: define the starting point in the image where the portion that needs to be decoded starts.
    • width, height: the size of the portion that will be decoded. Introduced in version V1.2
  • getProcessTimeOfLastDecoding(): Get the time in millisecond that lasted the last decoding operation. (Simply for statistical reasons)

  • decodingStarted(): signal emitted when decoding starts

  • decodingFinished(bool succeeded): signal emitted when decoding finishes reporting the success with the boolean.

  • tagFound(QString tag): emitted upon successful decoding of a barcode.

Examples

The repository contains 3 examples.

  • QQrDecoder: (25/08/16: the example project is outdated, needs to be updated) uses Qt Mobility 1.1.3 with QCamera , VideoFinder and QWidgets. This is the same project previously hosted in ?this project page and ?this wiki article (the project page from now gets deprecated since the project will be hosted here from now on). It has known issues that i hope will get fixed at some point:

No automatic focus thus the user needs to press a button to initiate focusing, capturing and eventually decoding. A few were unable to use it because it constantly throughs various erros such as "General Camera error".

  • QZXingDragNDropTest: A desktop application mostly for debugging purposes. Contains a Drag'n'Drop area where the user drags an image file and it gets decoded. The result, if successful, is show at the console log below the Drag'n'Drop area. Also it contains a component for enabling or disabling the active decoders. If no decoder is selected, the image will be tested against all the supported formats.

  • QMLBarcodeDecoder: Needs Qt Mobility 1.2 and Qt 4.7.4 because Camera qml component got supported from that version and on. Hope it will solve the problems we had in the QQrDecoder.

And for the closing here is a small pretty QML code contained in the above project showing how it is used:

Camera{
    id:camera
    onImageCaptured:{
	imageToDecode.source = preview
	decoder.decodeImageQML(imageToDecode);
    }
}

Image{
    id:imageToDecode
}

QZXing{
    id: decoder

    enabledDecoders: QZXing.DecoderFormat_QR_CODE
     
    onDecodingStarted: console.log("Decoding of image started...")

    onTagFound: console.log("Barcode data: " + tag)

    onDecodingFinished: console.log("Decoding finished " + (succeeded==true ? "successfully" :    "unsuccessfully") )
}

The End

If anyone needs anything feel free to ask in the project's forum.

Also your feedback is very important :)

Clone this wiki locally
言字五行属什么 敢爱敢恨是什么意思 更年期看什么科 混社会的人一般干什么 又吐又拉是什么原因
左侧卵巢多囊样改变什么意思 耕田是什么意思 尿路感染吃什么中成药 胃寒吃什么食物好 多维元素片有什么作用
葡萄糖为什么叫葡萄糖 吃饭流汗是什么原因 nt检查什么内容 乔迁送什么礼物好 尿蛋白高有什么危害
11度穿什么衣服 抖m是什么意思 鱼和熊掌不可兼得什么意思 吃辣椒有什么好处 吃什么好排大便
籍贯一般填什么hcv9jop3ns6r.cn 子宫脱落有什么症状hcv8jop5ns7r.cn 梦见洗澡是什么预兆hcv8jop0ns9r.cn 乙酰磺胺酸钾是什么hcv8jop8ns4r.cn 黄山毛峰是什么茶hcv8jop0ns1r.cn
负罪感什么意思hcv9jop5ns4r.cn 比目鱼是什么鱼qingzhougame.com 乳液是什么hcv7jop9ns0r.cn 什么颜色混合是红色hcv9jop0ns4r.cn 诡异是什么意思hcv8jop2ns1r.cn
脸发麻是什么病的前兆xinmaowt.com 红线是什么意思hcv9jop3ns2r.cn 11月16号是什么星座hcv8jop8ns3r.cn 肝血虚吃什么中成药hcv9jop5ns2r.cn 打乙肝疫苗挂什么科hcv8jop8ns5r.cn
硬膜囊前缘受压是什么意思hcv9jop3ns4r.cn 凉皮是用什么做的hcv8jop9ns6r.cn 米娜桑是什么意思hcv9jop1ns8r.cn 负责任是什么意思bfb118.com 先天性一个肾对人有什么影响hcv9jop2ns2r.cn
百度