Qt5编写hello world界面 纯代码版本
1、打开Qt软件点击new project进行项目的创建注意:因为是hello world,所以我这里详细的给出了如何创建项目当然,会的同学可以直接下一步

3、我们设置项目的文件名为:HelloWorld文件位置自定注意:文件名和位置最好都不要带有中文字符

5、这里基类我们选择的是QWidget类名自定,但是最好是有意义的这里我们的类名为:HelloWorldWidget创建界面那一项不要打钩,因为我们是代码编写界面

7、在helloworldwigdet.cpp添加如下两句:helloLabel = 艘绒庳焰new QLabel(this);hello讣嘬铮篌Label->setText("Hello World!");代码:#include "helloworldwigdet.h"HelloWorldWigdet::HelloWorldWigdet(QWidget *parent) : QWidget(parent){ helloLabel = new QLabel(this); helloLabel->setText("Hello World!");}HelloWorldWigdet::~HelloWorldWigdet(){}
