欢迎光临散文网 会员登陆 & 注册

QT基础教程 | QT入门 | 信号与槽

2023-06-25 21:27 作者:11122222222111  | 我要投稿


1、QT开发概述 P1 - 04:30




1、QT开发概述 P1 - 06:34







1、QT开发概述 P1 - 08:44



、、、、、、、、、、、、、、、、、、、、


2、Qt的编译 P2 - 00:12




infoLabel->setText("input cmd:");

#include <QApplication>//应用,面向对象

#include <QLabel>//tag header file ,create a label

#include <QLineEdit>

#include <QPushiButton>

#include <QHBoxLayout>//horizontal layout水平布局

#include <QVBoxLayout>//vertical layout垂直布局


int main(int argc,char *argv[])

{

QApplication app(argc,argv);


QLable *infoLabel()=new QLabel;

QLable *openLabel()=new QLabel;

QLineEdit *cmdLineEdit=new QLineEdit;

QPushButton *commitButton=new QPushButton;

QPushButton *cancelButton=new QPushButton;

QPushButton *browseButton=new QPushButton;


infoLabel->setText("input cmd:");

openLabe->setText("open");

commitButton->setText("commit");

cancelButton->setText("cancel");

browseButton->setText("browse");


QHBoxLayout *cmdLayout=new QHBoxLayout;//horizontal layout object/水平布局对象;

cmdLayout->addWidget(openLabel);//Add spacebar to horizontal object将控件加到水平对象里

//addWidget()添加控件

cmdLayout->addWidget(cmdLineEdit);


return app.exec();

}


控件,标签,行编辑框,文本编辑框,文字,布局,水平布局对象(布局也是对象),







































QT基础教程 | QT入门 | 信号与槽的评论 (共 条)

分享到微博请遵守国家法律