Important: Please read the Qt Code of Conduct -

Chinese Character in Qt

  • Hi friends,

    I have one problem in chinese character using in qt,, in the application window chinese characters are displayed correctly,,But when i take the receipt from the printer chinese characters are merged,,please give me some suggestion,, Thanks

  • quite uninformative question. Not sure whats the problem or the result should be. Show some code, current situation and desired situation so someone may help.

  • In here i just pass the string

    @@QString ItemPushButton::name_check(QString str)
    QRegExp [removed]"#([0-9]+);");
    QStringList list,list1;
    int pos = 0;
    int length;
    while((pos = expression.indexIn(str,pos))!=-1)
    list << expression.cap(1);
    QString v;
    length = expression.matchedLength();
    QByteArray ba = v.toUtf8();
    QString str1 = QString(QChar(v.toInt()));
    list1 <<str1;
    pos += expression.matchedLength();
    foreach (QString s, list) {
    str = str.replace("#","");
    str = str.replace(";","");

    foreach (QString s, list1) {
        str = str.append(s);
    return str;


    This return string is a chinese character,, I displayed this string in Qpushbutton,,In here chinese characters are displayed correctly,, But i pass this string to template and take the print means in the receipt chinese character are overwrite,,(i.e) If i pass the three chinese character means in the receipt bill it displayed 5 chinese character,,please give a suggestion,,,Thanks

Log in to reply