TZplPrinterV2 Class

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

Header: #include <TZplPrinterV2>
Inherits: QObject

Public Functions

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

Public Slots

QVariantMap connectionParam() const
QString getCmdStr(const QVariantMap &iData, TError *oErr = nullptr)
int maxPrintingOneTime() const
bool print(const QVariantMap &iData, TError *oErr = nullptr)
bool printByCommand(const QString &iCmdStr, 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

TZplPrinterV2::TZplPrinterV2(QObject *iParent = nullptr)

Default constructs an instance of TZplPrinterV2.

TZplPrinterV2::~TZplPrinterV2()

Destroys the instance of TZplPrinterV2.

[slot] QVariantMap TZplPrinterV2::connectionParam() const

返回连接参数

See also setConnectionParam().

[slot] QString TZplPrinterV2::getCmdStr(const QVariantMap &iData, TError *oErr = nullptr)

[slot] int TZplPrinterV2::maxPrintingOneTime() const

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

See also setMaxPrintingOneTime().

[slot] bool TZplPrinterV2::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 TZplPrinterV2::printByCommand(const QString &iCmdStr, TError *oErr = nullptr)

[slot] bool TZplPrinterV2::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 TZplPrinterV2::printParam() const

返回打印参数

See also setPrintParam().

[slot] void TZplPrinterV2::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 TZplPrinterV2::setMaxPrintingOneTime(int iValue)

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

See also maxPrintingOneTime().

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

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

See also printParam().

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

设置临时目录

See also tempDir().

[slot] QString TZplPrinterV2::tempDir() const

返回临时目录路径

See also setTempDir().