#include "mywidget.h"
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
//设置窗口的大小
this->resize(800,500);
//设置窗口标题
this->setWindowTitle("QQ");
//设置窗口图标
this->setWindowIcon(QIcon("C:\\Users\\50827\\Pictures\\qq.jpg"));
//创建按钮1
QPushButton *btn1 = new QPushButton("扫码登陆",this);
//移动按钮位置
btn1->move(250,390);
//设置按钮大小
btn1->resize(100,35);
//创建按钮2
QPushButton *btn2 = new QPushButton("更多选项",this);
//移动
btn2->move(450,390);
//设置按钮大小
btn2->resize(100,35);
//创建按钮3
QPushButton *btn3 = new QPushButton("登陆",this);
//移动
btn3->move(260,330);
//设置按钮大小
btn3->resize(280,30);
//创建账号编辑器
QLineEdit *edit1 = new QLineEdit("账号:",this);
//设置大小
edit1->resize(280,35);
//移动位置
edit1->move(260,190);
//创建密码编辑器
QLineEdit *edit2 = new QLineEdit(this);
//设置大小
edit2->resize(280,35);
//设置占位
edit2->setPlaceholderText(" 输入QQ密码");
//移动
edit2->move(260,240);
//设置显示模式
edit2->setEchoMode(QLineEdit::Password);
//创建标签
QLabel *lab1 = new QLabel("已阅读并同意服务协议和QQ隐私保护指引",this);
//设置大小
lab1->resize(500,100);
//移动
lab1->move(260,250);
QLabel *lab2 = new QLabel(" ",this);
//设置大小
lab2->resize(800,180);
//设置一个动图对象接受动图
QMovie *mv = new QMovie("C:\\Users\\50827\\Pictures\\20240613232200.gif");
//将动图设置到labe1中
lab2->setMovie(mv);
//让动图动起来
mv->start();
//让图片自适应
lab2->setScaledContents(true);
}MyWidget::~MyWidget()
{
}