我试图将字符串隐藏到QString,以便可以在QLineEdit或QLabel上显示该QString。这是我到目前为止拥有的一部分代码
char buff[100];
fgets(buff, sizeof(buff), fp);
//the buff[0] and buff[1] are two char values that I add up to make a string
std::string latitude = std::string() + buff[0] + buff[1];
QString::fromStdString(latitude);
this->ui->lineEdit->setText(latitude);
Run Code Online (Sandbox Code Playgroud)