01-08

发布时间:2024年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
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。