QT small white, want to output a string variable in interface controls (including Chinese), call QTool: : showMsg (" database connection failure ");
According to the code, including showMsg method for
Void QTool: : showMsg (QString text)
{
QString STR.
STR=QString (" % 1 "). Arg (text);
The UI - & gt; The label - & gt; SetText (STR);
}
CodePudding user response:
Added, I use the Qt5, also added QTextCodec: in the main function: setCodecForLocale (QTextCodec: : codecForName (' GBK ')); But still show the code
CodePudding user response: