#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);//设置标签qqQLabel *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)");}