#include "mywidget.h"MyWidget::MyWidget(QWidget *parent): QWidget(parent)
{//窗口相关设置this->setWindowTitle("登录窗口");this->setWindowIcon(QIcon("C:\\Users\\EDY\\Desktop\\pictrue\\qq.png"));this->setWindowFlag(Qt::FramelessWindowHint);this->setStyleSheet("background-color:white;border:3px");this->resize(430,330);//动图QLabel *lab1 = new QLabel(this);lab1->resize(430,120);QMovie *mv = new QMovie("C:\\Users\\EDY\\Desktop\\pictrue\\motion.gif");mv->start();lab1->setMovie(mv);lab1->setScaledContents(true);//qq图标QLabel *lab2 = new QLabel(this);lab2->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\icon.png"));lab2->move(15,15);lab2->resize(30,30);lab2->setScaledContents(true);//qq文字QLabel *lab3 = new QLabel(this);lab3->setText("QQ");lab3->setStyleSheet("background-color:transparent;color:white;front:20px");lab3->move(50,20);lab3->resize(40,20);QFont ft;ft.setPointSize(20);lab3->setFont(ft);//账号QLabel *lab4 = new QLabel(this);lab4->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\wodepeizhenshi.png"));lab4->move(96,172);lab4->resize(15,20);lab4->setScaledContents(true);QLineEdit *ed1 = new QLineEdit(this);ed1->move(121,168);ed1->resize(230,33);ed1->setPlaceholderText("QQ号码/手机/邮箱");//密码QLabel *lab5 = new QLabel(this);lab5->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\passwd.jpg"));lab5->move(96,200);lab5->resize(15,20);lab5->setScaledContents(true);QLineEdit *ed2 = new QLineEdit(this);ed2->move(121,196);ed2->resize(230,33);ed2->setPlaceholderText("密码");ed2->setEchoMode(QLineEdit::Password);//自动登录QCheckBox *box1 = new QCheckBox(this);box1->move(96,240);box1->resize(15,15);QLabel *lab6 = new QLabel(this);lab6->setText("自动登录");lab6->move(115,237);lab6->resize(50,20);//记住密码QCheckBox *box2 = new QCheckBox(this);box2->move(195,240);box2->resize(15,15);QLabel *lab7 = new QLabel(this);lab7->setText("记住密码");lab7->move(214,237);lab7->resize(50,20);//找回密码QLabel *lab8 = new QLabel(this);lab8->setText("找回密码");lab8->move(294,237);lab8->resize(50,20);//登录QPushButton *btn1 = new QPushButton("登录",this);btn1->move(96,270);btn1->resize(250,36);btn1->setStyleSheet("background-color:rgb(10,200,255);color:white;border-radius:3");//注册账号QPushButton *btn2 = new QPushButton("注册账号",this);btn2->move(15,306);btn2->resize(55,25);//二维码QLabel *lab9 = new QLabel(this);lab9->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\code.png"));lab9->move(393,300);lab9->resize(30,30);lab9->setScaledContents(true);//头像QLabel *lab10 = new QLabel(this);lab10->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\qq.png"));lab10->move(180,90);lab10->resize(70,70);lab10->setScaledContents(true);}MyWidget::~MyWidget()
{
}