TZplPrinter Class

斑马打印机的Qt封装 More...

Header: #include <TZplPrinter>
Inherits: QObject

Public Functions

TZplPrinter(QObject *iParent = nullptr)
~TZplPrinter()
  • 31 public functions inherited from QObject

Public Slots

QVariantMap connectionParam() const
int maxPrintingOneTime() const
bool print(const QVariantMap &iData, TError *oErr = nullptr)
bool printByList(const QVariantList &iData, TError *oErr = nullptr)
QVariantMap printParam() const
void setConnectionParam(const QVariantMap &iConnParam)
void setMaxPrintingOneTime(int iValue)
void setPrintParam(const QVariantMap &iPrintParam)
void setTempDir(const QString &iDir)
QString tempDir() const
  • 1 public slot inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 2 signals inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

斑马打印机的Qt封装

Member Function Documentation

TZplPrinter::TZplPrinter(QObject *iParent = nullptr)

Default constructs an instance of TZplPrinter.

TZplPrinter::~TZplPrinter()

Destroys the instance of TZplPrinter.

[slot] QVariantMap TZplPrinter::connectionParam() const

返回连接参数

See also setConnectionParam().

[slot] int TZplPrinter::maxPrintingOneTime() const

返回一次能最多打印的张数

See also setMaxPrintingOneTime().

[slot] bool TZplPrinter::print(const QVariantMap &iData, TError *oErr = nullptr)

打印标签(同一个标签*count) iData { "count": 1, "width": 80, "height": 40, "info": [ { "type": "BAR_CODE" | "QR_CODE" | "PICTURE", "x" : "", "y" : "", "width": "", "height": "", "value": "" }, { "type": "TEXT", "x" : "", "y" : "", "font_size": "", "value": "" }, { "type": "LINE", "x1": "", "y1": "", "x2": "", "y2": "", "weight": "" } ] }

[slot] bool TZplPrinter::printByList(const QVariantList &iData, TError *oErr = nullptr)

打印多个不同标签(标签A*count,标签B*count...),(若单个标签异常,会被跳过) iData [ { "count": 1, "width": 80, "height": 40, "info": [ { "type": "BAR_CODE" | "QR_CODE" | "PICTURE", "x" : "", "y" : "", "width": "", "height": "", "value": "" }, { "type": "TEXT", "x" : "", "y" : "", "font_size": "", "value": "" }, { "type": "LINE", "x1": "", "y1": "", "x2": "", "y2": "", "weight": "" } ] } ]

[slot] QVariantMap TZplPrinter::printParam() const

返回打印参数

See also setPrintParam().

[slot] void TZplPrinter::setConnectionParam(const QVariantMap &iConnParam)

设置连接参数 iConnParam { "host": "192.168.1.114", "port": 6101, "connection_type": "TCP", "printer_type": "ZT140" } { "lpt": "LPT1", "connection_type": "LPT", "printer_type": "GT800" }

See also connectionParam().

[slot] void TZplPrinter::setMaxPrintingOneTime(int iValue)

设置一次最多能打印多少张,默认为10

See also maxPrintingOneTime().

[slot] void TZplPrinter::setPrintParam(const QVariantMap &iPrintParam)

设置打印参数 iPrintParam { "chroma": 30, "zoom": 8, "margin_vertical": 1, "margin_horizontal": 2 }

See also printParam().

[slot] void TZplPrinter::setTempDir(const QString &iDir)

设置临时目录

See also tempDir().

[slot] QString TZplPrinter::tempDir() const

返回临时目录路径

See also setTempDir().