01-08
盗版UI
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//设置窗口大小
this->setFixedSize(881,550);
this->setStyleSheet("background-color:rgb(33,35,40)");
this->setWindowFlag(Qt::FramelessWindowHint);
//设置输入文本
QLineEdit *name=new QLineEdit(this);
name->move(55,150);
name->resize(482,54);
name->setStyleSheet("background-color:rgb(50,53,60);border-radius:2px;color:white");
name->setPlaceholderText("邮箱/手机/用户名");
QLineEdit *passwd=new QLineEdit(this);
passwd->move(55,240);
passwd->resize(482,54);
passwd->setStyleSheet("background-color:rgb(50,53,60);border-radius:2px;color:white");
passwd->setEchoMode(QLineEdit::Password);
//设置文字标签
QLabel *namewd=new QLabel("用账户名称登录",this);
namewd->move(55,130);
namewd->resize(110,20);
namewd->setStyleSheet("background-color:rgb(33,35,40);color:rgb(25,153,255)");
QLabel *pawd=new QLabel("密码",this);
pawd->move(55,220);
pawd->resize(110,20);
pawd->setStyleSheet("background-color:rgb(33,35,40);color:rgb(175,175,175)");
//设置图片标签
QLabel *logo=new QLabel(this);
logo->move(31,26);
logo->setFixedSize(307,77);
logo->setPixmap(QPixmap("C:\\Users\\12192\\Desktop\\pictrue\\logoo.png"));
logo->setScaledContents(1);
//设置按钮
QPushButton *cancel=new QPushButton("×",this);
cancel->move(841,0);
cancel->resize(40,40);
cancel->setStyleSheet("background-color:rgb(226,42,39);color:white");
QPushButton *enter=new QPushButton("登录",this);
enter->move(126,343);
enter->setFixedSize(340,60);
enter->setStyleSheet("background-color:rgb(25,156,255);color:white");
//设置动图
QLabel *mo=new QLabel(this);
mo->move(600,100);
mo->setFixedSize(125,125);
QMovie *monster=new QMovie("C:\\Users\\12192\\Desktop\\pictrue\\monster.gif");
mo->setMovie(monster);
monster->start();
mo->setScaledContents(1);
QLabel *we=new QLabel(this);
we->move(600,275);
we->setFixedSize(125,125);
QMovie *weapon=new QMovie("C:\\Users\\12192\\Desktop\\pictrue\\weapon.gif");
we->setMovie(weapon);
weapon->start();
we->setScaledContents(1);
}
MainWindow::~MainWindow()
{
}
原文地址:https://blog.csdn.net/limbojy0721/article/details/135465225
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!