1/10作业

#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    QObject::connect(this,&Widget::signal_login_success,this,&Widget::login_success);
    QObject::connect(this,&Widget::signal_login_failed,this,&Widget::login_failed);
    this->setWindowFlag(Qt::FramelessWindowHint);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_close_clicked()
{
    this->close();
}

void Widget::on_pushButton_login_clicked()
{
    if(ui->lineEdit_account->text()=="admin"&&ui->lineEdit_passwd->text()=="123456")
    {
        emit signal_login_success();
    }
    else if(ui->lineEdit_account->text()==""&&ui->lineEdit_passwd->text()=="")
    {

    }
    else
    {
        emit signal_login_failed();
        ui->lineEdit_passwd->setText("");
    }
}

void Widget::login_success()
{
   QMessageBox msgbox1(QMessageBox::Information,
                       "Steam",
                       "登录成功",
                       QMessageBox::Ok,
                       this);
   int ret=msgbox1.exec();
   if(ret==QMessageBox::Ok)
   {
       this->close();
   }


}

void Widget::login_failed()
{
    QMessageBox msgbox2(QMessageBox::Information,
                        "Steam",
                        "账号或密码错误",
                        QMessageBox::Ok,
                        this);
    int ret=msgbox2.exec();
}

QLabel#label_back{
	border-image: url(:/lll/back.png);}
#label_steam{
	border-image: url(:/lll/steam.png);}
#label_ewm{
	border-image: url(:/lll/ewm.png);
	border-radius:13px;}
#label_tip_account{
	background:transparent;
	color: rgb(255, 255, 255);}
#label_tip_passwd{
	background:transparent;
	color: rgb(255, 255, 255);}
#label_useewm{
	background:transparent;
	color: rgb(255, 255, 255);}
#label_phone{
	background:transparent;
	color: rgb(255, 255, 255);}
#label_without{
	background:transparent;
	color: rgb(255, 255, 255);}




QPushButton#pushButton_close{
	border-image: url(:/lll/x.png);}
#pushButton_close:hover{
	border-image: url(:/lll/qq.png);}
#pushButton_add{
	color: rgb(255, 255, 255);
	background:transparent;
	border:none;
	border-bottom:1px solid rgb(255, 255, 255);}
#pushButton_login{
	border:none;
	color: rgb(255, 255, 255);
	border-radius:3px ;
	background-color: qlineargradient(spread:pad, x1:1, y1:0.511773, x2:0, y2:0.499727, stop:0.393035 rgba(42, 120, 255, 255), stop:1 rgba(126, 173, 255, 255));
	font: 13pt "等线";}
#pushButton_login:hover{
	border:none;
	color: rgb(255, 255, 255);
	border-radius:3px ;
	background-color: qlineargradient(spread:pad, x1:1, y1:0.511773, x2:0, y2:0.499727, stop:0.393035 rgba(32, 110, 245, 255), stop:1 rgba(116, 163, 245, 245));
	font: 13pt "等线";}
#pushButton_login:pressed{
	padding-left:2px;
	padding-top:2px;
	border:none;
	color: rgb(255, 255, 255);
	border-radius:3px ;
	background-color: qlineargradient(spread:pad, x1:1, y1:0.511773, x2:0, y2:0.499727, stop:0.393035 rgba(42, 120, 255, 255), stop:1 rgba(126, 173, 255, 255));
	font: 13pt "等线";}
#pushButton_add{
	
	border:none;}






QLineEdit#lineEdit_account{
	border:none;
	background-color: rgb(50, 53, 60);
	color: rgb(255, 255, 255);}

#lineEdit_passwd{
	border:none;
	background-color: rgb(50, 53, 60);
	color: rgb(255, 255, 255);}
QWidget{
	background-color: qlineargradient(spread:pad, x1:0.513, y1:0, x2:0.498, y2:1, stop:0 rgba(33, 35,40, 255), stop:1 rgba(25, 26, 30, 255));}

QCheckBox{
	color: rgb(255, 255, 255);}






	

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值