作者:刘小飘168585 | 来源:互联网 | 2023-02-02 14:49
再介绍QPushButton之前,先介绍下引用控件时需要加入头文件,还需要加入相关的模块编译才能成功。例如QPushButton类的模块为widget,因为QT5的widget已经默认加
再介绍QPushButton之前,先介绍下引用控件时需要加入头文件,还需要加入相关的模块编译才能成功。例如
QPushButton类的模块为widget,因为QT5的widget已经默认加入到PRO文件里面所以不用添加如下图所示

但是不是所有的类都是默认添加,有的需要手动添加下去如QUdp:它的模块是network。就需要再por文件中加入network。



另外还介绍一下其他的功能

下面是创建QPushButton和窗口简单设置,直接上图上代码
此代码是在mywidget.cpp中完成的