Qt Development Practice Guide(0)

Development environment:

Reference: [Introduction to QT Basics] 1. QT development environment construction

 First UI desktop design

1, project design

UI design

Double click:

 Check the "Calculate" button to go to the bad

 

 

Write code

       bool ok;
       QString tempStr;
       QString valueStr=ui->radiusLineEdit->text();
       int valueInt=valueStr.toInt(&ok);
       double area=valueInt*valueInt*PI;//计算圆面积
       ui->areaLabel_2->setText(tempStr.setNum(area));

 Effect:

 It is very similar to c# developed many years ago

Guess you like

Origin blog.csdn.net/luozhonghua2014/article/details/126437844