• 大小: 257KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-21
  • 语言: 其他
  • 标签: Qt  二维码  打印  

资源简介

输入字符串自动转换二维码图案,并支持打印机打印输出。

资源截图

代码片段和文件信息

/* 
 * QR Code generator library (C++)
 * 
 * Copyright (c) Project Nayuki. (MIT License)
 * https://www.nayuki.io/page/qr-code-generator-library
 * 
 * Permission is hereby granted free of charge to any person obtaining a copy of
 * this software and associated documentation files (the “Software“) to deal in
 * the Software without restriction including without limitation the rights to
 * use copy modify merge publish distribute sublicense and/or sell copies of
 * the Software and to permit persons to whom the Software is furnished to do so
 * subject to the following conditions:
 * - The above copyright notice and this permission notice shall be included in
 *   all copies or substantial portions of the Software.
 * - The Software is provided “as is“ without warranty of any kind express or
 *   implied including but not limited to the warranties of merchantability
 *   fitness for a particular purpose and noninfringement. In no event shall the
 *   authors or copyright holders be liable for any claim damages or other
 *   liability whether in an action of contract tort or otherwise arising from
 *   out of or in connection with the Software or the use or other dealings in the
 *   Software.
 */

#include “BitBuffer.hpp“


namespace qrcodegen {

BitBuffer::BitBuffer()
: std::vector() {}


std::vector BitBuffer::getBytes() const {
std::vector result(size() / 8 + (size() % 8 == 0 ? 0 : 1));
for (std::size_t i = 0; i < size(); i++)
result[i >> 3] |= (*this)[i] ? 1 << (7 - (i & 7)) : 0;
return result;
}


void BitBuffer::appendBits(std::uint32_t val int len) {
if (len < 0 || len > 31 || val >> len != 0)
throw “Value out of range“;
for (int i = len - 1; i >= 0; i--)  // Append bit by bit
this->push_back(((val >> i) & 1) != 0);
}

}

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

     文件       1827  2018-06-25 05:02  genQrCode_ok\BitBuffer.cpp

     文件       1895  2018-06-25 05:02  genQrCode_ok\BitBuffer.hpp

     文件       1149  2018-06-28 22:46  genQrCode_ok\genQrCode_ok.pro

     文件      23874  2018-09-11 15:39  genQrCode_ok\genQrCode_ok.pro.user

     文件      18733  2018-06-09 17:05  genQrCode_ok\genQrCode_ok.pro.user.8737b3b

     文件     167818  2014-03-08 17:31  genQrCode_ok\logo.png

     文件        183  2018-06-09 17:03  genQrCode_ok\main.cpp

     文件       1071  2018-07-03 14:24  genQrCode_ok\mainwindow.cpp

     文件        465  2018-06-28 22:36  genQrCode_ok\mainwindow.h

     文件       5335  2018-06-29 20:22  genQrCode_ok\mainwindow.ui

     文件      19031  2018-06-09 18:12  genQrCode_ok\medal.png

     文件       1174  2018-07-03 15:09  genQrCode_ok\myqrcode.cpp

     文件        397  2018-07-03 11:28  genQrCode_ok\myqrcode.h

     文件      20586  2018-06-25 05:02  genQrCode_ok\QrCode.cpp

     文件       5777  2018-06-29 20:49  genQrCode_ok\qrcode.h

     文件      12443  2018-06-25 05:02  genQrCode_ok\QrCode.hpp

     文件       4284  2014-03-08 17:31  genQrCode_ok\qrencode\bitstream.c

     文件       1432  2014-03-08 17:31  genQrCode_ok\qrencode\bitstream.h

     文件       2708  2014-03-08 17:31  genQrCode_ok\qrencode\config.h

     文件       6929  2014-03-08 17:31  genQrCode_ok\qrencode\mask.c

     文件       1560  2014-03-08 17:31  genQrCode_ok\qrencode\mask.h

     文件       4078  2014-03-08 17:31  genQrCode_ok\qrencode\mmask.c

     文件       1404  2014-03-08 17:31  genQrCode_ok\qrencode\mmask.h

     文件       7063  2014-03-08 17:31  genQrCode_ok\qrencode\mqrspec.c

     文件       4774  2014-03-08 17:31  genQrCode_ok\qrencode\mqrspec.h

     文件      20071  2014-03-08 17:31  genQrCode_ok\qrencode\qrencode.c

     文件      20916  2014-03-08 17:31  genQrCode_ok\qrencode\qrencode.h

     文件       2778  2014-03-08 17:31  genQrCode_ok\qrencode\qrencode_inner.h

     文件      38941  2014-03-08 17:31  genQrCode_ok\qrencode\qrinput.c

     文件       3651  2014-03-08 17:31  genQrCode_ok\qrencode\qrinput.h

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

评论

共有 条评论