2024.4.8作业

#include "mainwindow.h"
#include "ui_mainwindow.h"

  
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->logoLab->setPixmap(QPixmap(":/C:/Users/l1693/Desktop/pictures/1.png"));
    ui->logoLab->setScaledContents(true);
    connect(ui->btn2,SIGNAL(clicked()),this,SLOT(my_slot()));
    connect(ui->btn1,SIGNAL(clicked()),this,SLOT(my_slot1()));
}

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

  
void MainWindow::my_slot()
{
    close();
}

  
void MainWindow::my_slot1()
{
    if(ui->userNameEdit->text() == "admin" && ui->passwdEdit->text() == "123456")
    {
        QLabel *lab1 = new QLabel("登陆成功",this);
        lab1->resize(200,100);
        lab1->move(0,0);
        close();
    }
    else
    {
        ui->passwdEdit->text() = "";
        QLabel *lab1 = new QLabel("登录失败",this);
        lab1->resize(200,100);
        lab1->move(0,0);
    }
}

 

                

相关推荐

  1. 【Leetcode】【2024048】1544. Make The String Great

    2024-04-09 14:36:03       14 阅读
  2. 作业..........

    2024-04-09 14:36:03       34 阅读
  3. 20240203作业

    2024-04-09 14:36:03       29 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-09 14:36:03       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-09 14:36:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-09 14:36:03       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-09 14:36:03       20 阅读

热门阅读

  1. 3.10 Python数据类型转换

    2024-04-09 14:36:03       8 阅读
  2. c#有dll源码,整合到自己的exe中

    2024-04-09 14:36:03       12 阅读
  3. SQL Server 数据类型

    2024-04-09 14:36:03       13 阅读
  4. 目标 url 存在 host 头攻击漏洞

    2024-04-09 14:36:03       16 阅读
  5. 软件测试与QA的区别

    2024-04-09 14:36:03       13 阅读
  6. 题目:学习使用按位与 & 。

    2024-04-09 14:36:03       11 阅读
  7. MYSQL 5.7重置root密码

    2024-04-09 14:36:03       9 阅读
  8. idea 使用springboot helper 创建springboot项目

    2024-04-09 14:36:03       11 阅读
  9. git lfs如何使用

    2024-04-09 14:36:03       11 阅读
  10. 云数据库AWS Aurora(一)

    2024-04-09 14:36:03       10 阅读
  11. 关于ros中的回旋函数

    2024-04-09 14:36:03       12 阅读
  12. git知识

    git知识

    2024-04-09 14:36:03      9 阅读
  13. docker安装minio

    2024-04-09 14:36:03       12 阅读