Welcome, Guest. Please login or register.
Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - eqychan

Pages: [1]
1
I am not professional in coding... sorry ;)

2
// 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);
...
...

3
LimeReport use zint library to support barcodes. You have to turn on zint support in the limereport.pro. Remove comment before CONFIG +=zint and configure zint library.
What about CJK character. According to the documentation zint can use UTF-8 but maybe something wrong between zint and barcode item.
thanks for your reply! following your instructions, I resolved the barcode problem. :)
I changed source code in your lrbarcodeitem.cpp to resolve the CJK problem by adding a function to find whether the input string contains CJK character, if true, change barcode input mode to 0, otherwise do nothing. now it works fine!:D

4
LimeReport is perfect! thanks.
QRCode Barcode item cannot handle CJK character, and there is no barcode item in LimeReport::ReportDesignWindow(). would you plan to add it in the next version?

Pages: [1]