Dizgah
31st October 2017, 05:58
I wrote a very simple test code,which receive a utf8 string from QLineEdit and display it in messagebox:
QString txtString = ui->lineEdit->text();
QString scndString = txtString.toUtf8();
QMessageBox msgBox;
msgBox.setText(scndString);
msgBox.exec();
Know I want to display utf8 hex value of string instead of string itself, but when I try to do this :
QString txtString = ui->lineEdit->text();
QString scndString = txtString.toLatin1.toutf8.toHex();
QMessageBox msgBox;
msgBox.setText(scndString);
msgBox.exec();
I received this message:
error: 'txtString.QString::toLatin1' does not have class type QString scndString = txtString.toLatin1.toutf8.toHex();
QString txtString = ui->lineEdit->text();
QString scndString = txtString.toUtf8();
QMessageBox msgBox;
msgBox.setText(scndString);
msgBox.exec();
Know I want to display utf8 hex value of string instead of string itself, but when I try to do this :
QString txtString = ui->lineEdit->text();
QString scndString = txtString.toLatin1.toutf8.toHex();
QMessageBox msgBox;
msgBox.setText(scndString);
msgBox.exec();
I received this message:
error: 'txtString.QString::toLatin1' does not have class type QString scndString = txtString.toLatin1.toutf8.toHex();