bool ok;
    QString  stempStr;
    QString valueStr=ui->lineEdit->text();//提取text中内容
    int valueInt=valueStr.toInt(&ok);//将字符串转化为整形
    double area=valueInt*valueInt*PI;
    ui->lineEdit_2->setText(stempStr.setNum(area));//将double转化为字符串

 

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-11-03
  • 2021-05-19
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案