cpp
#include "mywidget.h"
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
//设置窗口的大小
this->resize(645,497);
//设置窗口名字
this->setWindowTitle("QQ");
//设置窗口图标
this->setWindowIcon(QIcon("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\qq.png"));
//设置背景颜色
this->setStyleSheet("Background-color:rgb(255,255,255)");
//设置标签动图
QLabel *lab1 = new QLabel(this);
lab1->resize(645,190);
//接收动图类
QMovie *mv1= new QMovie("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\zz.gif");
lab1->setMovie(mv1);
mv1->start();
//自适应
lab1->setScaledContents(true);
//设置标签qq
QLabel *lab2 = new QLabel(this);
lab2->resize(25,32);
lab2->move(150,265);
lab2->setPixmap(QPixmap("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\qqe.png"));
lab2->setScaledContents(true);
//设置标签锁
QLabel *lab3 = new QLabel(this);
lab3->resize(25,32);
lab3->move(150,323);
lab3->setPixmap(QPixmap("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\suo.png"));
lab2->setScaledContents(true);
//设置标签文本"QQ号码/手机/邮箱"
QLineEdit *edit1 = new QLineEdit(this);
edit1->resize(310,45);
edit1->move(175,265);
edit1->setPlaceholderText("QQ号码/手机/邮箱");
//设置标签文本密码
QLineEdit *edit2 = new QLineEdit(this);
edit2->resize(310,45);
edit2->move(175,323);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
//设置登陆按钮
QPushButton *btn1 = new QPushButton("登录",this);
btn1->resize(357,54);
btn1->move(144,414);
btn1->setStyleSheet("Background-color:rgb(7,188,252)");
}