#include "widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
//====窗口相关设置====
//设置窗口标题
this->setWindowTitle("游戏登录");
//设置窗口图标
this->setWindowIcon(QIcon("D:\\tupian\\pictrue\\logo.png"));
//重新设置背景颜色
this->setStyleSheet("background-color:rad(255,255,255)");
//重新设置窗口大小
this->resize(1040,820);
//固定窗口大小
this->setFixedSize(1040,820);
//====标签相关设置====
QLabel *lab1 = new QLabel;
//设置父类组件
lab1->setParent(this);
//设置标签框大小
lab1->resize(1040,820);
//设置颜色
lab1->setStyleSheet("background-color:green");
//动图类
QMovie *mv = new QMovie("D:\\tupian\\pictrue\\192429u7qvi2ylpq2pyymi.gif");
mv->setParent(this);
//将图设置到标签中
lab1->setMovie(mv);
//设置为动图
mv->start();
lab1->setScaledContents(true);
//设置登录标签
QLabel *lab2 = new QLabel(this);
lab2->resize(50,50);
lab2->move(320,500);
lab2->setPixmap(QPixmap("D:\\tupian\\pictrue\\fd16e36b_E772821_29be78fe.png"));
lab2->setScaledContents(true);
QLabel *lab3 = new QLabel(this);
lab3->resize(50,50);
lab3->move(320,600);
lab3->setPixmap(QPixmap("D:\\tupian\\pictrue\\defe236e_E369263_d031f903.png"));
lab3->setScaledContents(true);
//=====行编辑器相关设置
QLineEdit *edit1 = new QLineEdit(this);
edit1->resize(390,70);
edit1->move(380,495);
edit1->setPlaceholderText("游戏用户名/手机号/QQ号");
edit1->setStyleSheet("background-color:rgb(0,17,34);color:white;border-radius:10px");
QLineEdit *edit2 = new QLineEdit(this);
edit2->resize(390,70);
edit2->move(380,595);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
edit2->setStyleSheet("background-color:rgb(0,17,34);color:white;border-radius:70px");
//=====按钮相关设置
QPushButton *btn = new QPushButton("登录游戏" ,this);
btn->resize(440,85);
btn->move(320,670);
btn->setStyleSheet("background-color:rgb(0,0,0);color:red;border-radius:70px");
}
Widget::~Widget()
{
}