Print receipt: encode QString

This commit is contained in:
Siegfried Siegert 2024-06-27 11:55:35 +02:00
parent 32d70abf44
commit 72dbc8b858
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -654,10 +654,21 @@ void ATBDeviceControllerPlugin::requestPrintReceipt(const QHash<QString, QVarian
void ATBDeviceControllerPlugin::requestPrintReceipt(const QString & printingString)
{
QByteArray ba = printingString.toUtf8();
QByteArray ba_receipt = this->codec->fromUnicode(printingString);
//QByteArray ba = printingString.toUtf8();
hw->prn_switchPower(true);
hw->prn_setFonts(8,12,0,0);
hw->prn_sendText(&ba);
hw->prn_sendText(&ba_receipt);
// DEBUG
//qCritical() << "---------------------------------------------------------------";
//qCritical() << "ATBDeviceControllerPlugin::requestPrintReceipt()";
//qCritical() << " receipt data:";
//qCritical() << QString(ba_receipt);
//qCritical() << "---------------------------------------------------------------";
this->printResultCheckCounter = 0;
QTimer::singleShot(4000, this, SLOT(onPrinterWaitForPrintingReceipt()));