#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
//窗口标题
this->setWindowTitle("学生登录系统");
//窗口图标
this->setWindowIcon(QIcon("C:\\Users\\86132\\Desktop\\pictrue\\wodepeizhenshi.png"));
//纯净窗口
this->setWindowFlag(Qt::FramelessWindowHint);
//背景颜色
this->setStyleSheet("background-color:white");
//设置窗口大小
this->resize(540,410);
//固定窗口大小
this->setFixedSize(540,410);
//设置标签
QLabel *lab1 = new QLabel(this);
lab1->resize(540,160);
lab1->setStyleSheet("background-color:green");
QLabel *userNameLab = new QLabel("账号:",this);
userNameLab->resize(35,50);
userNameLab->move(120,210);
QLabel *passwdLab = new QLabel("密码:",this);
passwdLab->resize(35,50);
passwdLab->move(120,250);
//设置动图
QMovie *mv = new QMovie("C:\\Users\\86132\\Pictures\\Camera Roll\\th (5).jpg");
mv->setParent(this);
lab1->setMovie(mv);
mv->start();
lab1->setScaledContents(true);
//行编译器
QLineEdit *userNameEdit = new QLineEdit(this);
userNameEdit->move(165,210);
userNameEdit->resize(270,35);
userNameEdit->setPlaceholderText("学号");
QLineEdit *passwdEdit = new QLineEdit(this);
passwdEdit->move(165,250);
passwdEdit->resize(270,35);
passwdEdit->setPlaceholderText("密码");
//按钮
QPushButton *login = new QPushButton("登录",this);
login->move(120, 290);
login->resize(315,45);
login->setStyleSheet("background-color:rgb(31,200,153);color:white;border-radius:10px");
}
Widget::~Widget()
{
delete ui;
}
QT day1
最新推荐文章于 2024-11-04 14:53:01 发布