Qt 从LineEdit中获得中文汉字输入.

#include

... ...

QString text = QTextCodec::codecForName("GBK")->fromUnicode(ui->inputEdit->text());

char* ss = text.toAscii().data();

... ...

你可能感兴趣的:(QT)