From baf56daa1795de8de7958ed5ab7348f2c840a100 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sun, 21 Jan 2018 14:59:15 +0000 Subject: [PATCH] Don't display warning 222 in GUI --- backend_qt/qzint.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp index ee12d6b3..d7222ed3 100644 --- a/backend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -81,9 +81,8 @@ namespace Zint { QByteArray bstr = m_text.toUtf8(); QByteArray pstr = m_primaryMessage.left(99).toLatin1(); strcpy(m_zintSymbol->primary, pstr.data()); - int error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length()); - if (error > ZINT_WARN_INVALID_OPTION) - m_lastError = m_zintSymbol->errtxt; + m_error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length()); + m_lastError = m_zintSymbol->errtxt; if (m_zintSymbol->symbology == BARCODE_MAXICODE) m_zintSymbol->height = 33; @@ -317,7 +316,8 @@ namespace Zint { QFont fontLarge(fontstyle); fontLarge.setPixelSize(fontPixelSizeLarge); - if (m_lastError.length()) { + if (m_error >= 5) { + // Display error message instead of barcode fontLarge.setPointSize(14); painter.setFont(fontLarge); painter.drawText(paintRect, Qt::AlignCenter, m_lastError);