1.思维导图
2.设计一个简单登录界面
#include "mywidget.h"MyWidget::MyWidget(QWidget *parent): QWidget(parent)
{this->setWindowTitle("原神启动");
// this->setStyleSheet("background-color:rgb(255,184,64)");this->setStyleSheet("background-image:C:/Users/34383/Desktop/电信203孙自潘/新建文件夹 (3)/QQ截图20240206142709.png");//*******¥¥¥¥¥¥猿神启动¥¥¥¥¥¥******************// 动图类 QMovie//界面大小this->resize(1080,1080);//界面背景颜色this->setStyleSheet("background-color:rgb(152,195,106)");//第一个标签QLabel *labx = new QLabel(this);labx->resize(108*2,108*2);//大小labx->move(144*3,144*2);//位置//动图QMovie *mv = new QMovie("D:\\QQ\\awendang\\MobileFile\\2310663110.gif");mv->setParent(this);//固定在界面内labx->setMovie(mv);//动图放标签内mv->start();//动图开始演示labx->setScaledContents(true);//自适应大小//第二个标签QLabel *labx1 = new QLabel(this);labx1->resize(238,238);labx1->move(144*1,144*1);//动图QMovie *mv1 = new QMovie("D:\\QQ\\awendang\\MobileFile\\2309668879.gif");mv1->setParent(this);labx1->setMovie(mv1);mv1->start();labx1->setScaledContents(true);//第三个标签QLabel *laby1 = new QLabel(this);laby1->resize(238,238);laby1->move(144*5,144*1);//动图QMovie *mv2 = new QMovie("D:\\QQ\\awendang\\MobileFile\\2309668879.gif");mv2->setParent(this);laby1->setMovie(mv2);mv2->start();laby1->setScaledContents(true);//********************************//账户标签QLabel *lab1 = new QLabel(this);lab1->resize(30,30);lab1->move(144*3-40,144*2+216+40);lab1->setPixmap(QPixmap("C:\\Users\\34383\\Desktop\\电信203孙自潘\\新建文件夹 (3)\\QQ截图20240117225704.png"));lab1->setScaledContents(true);//密码标签QLabel *lab2 = new QLabel(this);lab2->resize(30,30);lab2->move(144*3-40,144*2+216+80);lab2->setPixmap(QPixmap("C:\\Users\\34383\\Desktop\\电信203孙自潘\\新建文件夹 (3)\\QQ截图20231227120915.png"));lab2->setScaledContents(true);//最上面标签QLabel *lab3 = new QLabel("即将撬开门扉,原神启动",this);// lab3->setStyleSheet("QLabel { text-align: center; }");lab3->setFont(QFont("Arial", 20));//lab3->resize(1080,144);lab3->move(0,0);lab3->setStyleSheet("background-color:rgb(255,134,138)");//账户行编辑器QLineEdit *edit1 =new QLineEdit(this);edit1->resize(270,35);edit1->move(144*3,144*2+216+40);edit1->setPlaceholderText("QQ号码/手机/邮箱");//使初始字虚化//密码行编辑器QLineEdit *edit2 =new QLineEdit(this);edit2->resize(270,35);edit2->move(144*3,144*2+216+80);edit2->setEchoMode(QLineEdit::Password);//显示模式//登录按钮QPushButton *btn1 = new QPushButton("登录",this);btn1->move(144*3-40,144*2+216+80+40);btn1->resize(310,35);btn1->setStyleSheet("background-color:grb(7,190,251)");
}MyWidget::~MyWidget()
{
}