void Widget::on_pushButton_clicked()
{
QString text = ui->lineEdit->text();
if(!text.isEmpty()){
bool exist;
QString unsupport_chinese("");
QString chinese = getChinese(text);
for (int i = 0; i < chinese.count(); ++i) {
bool ok;
//qDebug()<<__PRETTY_FUNCTION__<<chineseToHex(text).toInt(&ok,16)<<0x6c49<<QString(QChar(0x4e2d))<<0x4e2d;
//显示该文本及是否存在在字库中
qDebug()<<__PRETTY_FUNCTION__<<__LINE__<<QString(chinese.at(i));
QChar ch = chineseToHex(chinese.at(i)).toInt(&ok,16);
exist = contains_chinese_char(ch);
if(!exist){
unsupport_chinese.append(QString(chinese.at(i)));
}
}
ui->label->setText(text + " : " + unsupport_chinese + ((unsupport_chinese.isEmpty()) ? ":存在此字库中":":不存在此字库中"));
}else{
ui->label->setText("请在行编辑输入字符串");
}
}
demo链接:https://download.csdn.net/download/wandaozhong/89164500
依赖资源链接:https://download.csdn.net/download/wandaozhong/89164675