// My Code start ----------------------------------------------------
bool hasCJK(QString qs)
{
int qslen = qs.length();
if (qslen == 0)
return false;
else if (qslen == qs.toLocal8Bit().length())
return false;
return true;
}
// My code end ------------------------------------------------------
void BarcodeItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
ppainter->save();
Zint::QZint bc;
// Original code Start -----------------------------------------------------------------------
// if (itemMode() & DesignMode) bc.setText(m_designTestValue);
// else bc.setText(m_content);
// Original code end -------------------------------------------------------------------------
// My Code Start -----------------------------------------------------------------------------
QString qs;
if (itemMode() & DesignMode) qs = m_designTestValue;
else qs = m_content;
if (hasCJK(qs))
bc.setInputMode(0);
bc.setText(qs);
// My code end --------------------------------------------------------------------------------
bc.setSymbol(m_barcodeType);
bc.setWhitespace(m_whitespace);
bc.setFgColor(m_foregroundColor);
...
...