QT

#include "widget.h"

#include "ui_widget.h"

Widget::Widget(QWidget *parent)

: QWidget(parent)

, ui(new Ui::Widget)

,Gcancle(new QPushButton("取消",this))

,EmmEdit(new QLineEdit(this))

{

ui->setupUi(this);

ui->ALogo->setPixmap(QPixmap("://pic//th.jpg"));

ui->ALogo->setScaledContents((true));

ui->Bzhanghao->setPixmap(QPixmap(":/pic/wodepeizhenshi.png"));

ui->Bzhanghao->setScaledContents((true));

ui->Cmima->setPixmap(QPixmap("://pic//passwd.jpg"));

ui->Cmima->setScaledContents((true));

Gcancle->resize(ui->Flogin->width(),ui->Flogin->height());

Gcancle->move(ui->Flogin->x()+ui->Flogin->width()+15,ui->Flogin->y());

connect(Gcancle,SIGNAL(clicked()),this,SLOT(my_slot1()));

this->EmmEdit->resize(ui->DzhEdit->width(),ui->DzhEdit->height());

this->EmmEdit->move(ui->DzhEdit->x(),ui->DzhEdit->y()+ui->DzhEdit->height()+12);

connect(this->EmmEdit,SIGNAL(clicked()),this,SLOT(my_slot2()));

this->EmmEdit->setEchoMode(QLineEdit::Password);

}

Widget::~Widget()

{

delete ui;

}

void Widget::my_slot1()

{

this->close();

}

void Widget::my_slot2()

{

QString zh = ui->DzhEdit->text();

QString mm = this->EmmEdit->text();

if(zh == "admin" && mm == "123456")

{

QMessageBox::information(this, "登录", "登陆成功");

this->close();

}else

{

QMessageBox::warning(this, "登录", "登录失败");

ui->DzhEdit->clear();

this->EmmEdit->clear();

}

}

相关推荐
步菲44 分钟前
springboot canche 无法避免Null key错误, Null key returned for cache operation
java·开发语言·spring boot
知远同学6 小时前
Anaconda的安装使用(为python管理虚拟环境)
开发语言·python
小徐Chao努力6 小时前
【Langchain4j-Java AI开发】09-Agent智能体工作流
java·开发语言·人工智能
CoderCodingNo6 小时前
【GESP】C++五级真题(贪心和剪枝思想) luogu-B3930 [GESP202312 五级] 烹饪问题
开发语言·c++·剪枝
kylezhao20196 小时前
第1章:第一节 开发环境搭建(工控场景最优配置)
开发语言·c#
啃火龙果的兔子6 小时前
JavaScript 中的 Symbol 特性详解
开发语言·javascript·ecmascript
热爱专研AI的学妹7 小时前
数眼搜索API与博查技术特性深度对比:实时性与数据完整性的核心差异
大数据·开发语言·数据库·人工智能·python
Mr_Chenph7 小时前
Miniconda3在Windows11上和本地Python共生
开发语言·python·miniconda3
阿狸远翔7 小时前
Protobuf 和 protoc-gen-go 详解
开发语言·后端·golang
永远前进不waiting7 小时前
C复习——1
c语言·开发语言