myqt.cpp
this->setFixedSize(500,500);//设置固定尺寸
//关于界面标题的函数
qDebug()<<this->windowTitle();
this->setWindowTitle("QQ");
//设置窗口图标
this->setWindowIcon(QIcon(":/3.jpg"));
//设置背景颜色
this->setStyleSheet("background-color:skyblue;");
//实例化一个标签,给定父组件并给定初始文本内容
l1=new QLabel("密码",this);
l1->move(130,300);
l2=new QLabel("账号",this);
l2->move(130,250);
//实例化一个喊编辑器
e1=new QLineEdit(this);
e1->move(170,300);
e1->setEchoMode(QLineEdit::Password);//设置行编辑器回显模式 设置密文模式
e1->setPlaceholderText("请输入密码");//设置占位文本
//实例化一个喊编辑器
e2=new QLineEdit(this);
e2->move(170,250);
//e2->setEchoMode(QLineEdit::Password);//设置行编辑器回显模式 设置密文模式
e2->setPlaceholderText("请输入账号");//设置占位文本
myqt.h
private:
QLabel *l1;
QLabel *l2;
QLineEdit *e1;
QLineEdit *e2;
ui