嵌入式学习记录6.14(练习)

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

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
      this->resize(1028,783);
//设置左侧背景
    QLabel *lab1=new QLabel(this);
   lab1->move(0,0);
//       lab1->setPixmap(QPixmap("C:\\Users\\zy\\Desktop\\share\\4.png"));
    lab1->resize(550,783);
//        lab1->setScaledContents(true);

QMovie *mv = new QMovie("C:\\Users\\zy\\Desktop\\share\\1.gif");
        lab1->setMovie(mv);
        mv->start();
        lab1->setScaledContents(true);




   QLabel *lab2=new QLabel(this);//tim图标
   lab2->move(20,5);
   lab2->setPixmap(QPixmap("C:\\Users\\zy\\Desktop\\share\\5.png"));
   lab2->resize(115,55);
   lab2->setScaledContents(true);
    lab2->setStyleSheet("background-colour:rgb(211,183,166)");

    QLabel *lab3=new QLabel(this);//qq图标
    lab3->move(690,183);
    lab3->setPixmap(QPixmap("C:\\Users\\zy\\Desktop\\share\\6.png"));
    lab3->resize(100,100);
    lab3->setScaledContents(true);

    QLabel *lab4=new QLabel(this);//wx图标
    lab4->move(800,183);
    lab4->setPixmap(QPixmap("C:\\Users\\zy\\Desktop\\share\\8.png"));
    lab4->resize(100,100);
    lab4->setScaledContents(true);

        ui->lineEdit1->setPlaceholderText("手机号:");
          ui->lineEdit2->setPlaceholderText("密码:");
         ui->lineEdit2->setEchoMode(QLineEdit::Password);
      ui->bt->setIcon(QIcon("C:\\Users\\zy\\Desktop\\share\\9.png"));

     ui->bt->setIconSize(QSize(50, 50)); // 设置图标的大小,例如64x64像素
       QLabel *lab5=new QLabel("记住密码",this);
       lab5->move(629,663);
       lab5->resize(80,20);


       QLabel *lab6=new QLabel("自动登录",this);
       lab6->move(629,713);
       lab6->resize(80,20);

       QLabel *lab7=new QLabel("找回密码",this);
       lab7->move(908,663);
       lab7->resize(80,20);


       QLabel *lab8=new QLabel("注册账号",this);
       lab8->move(908,713);
       lab8->resize(80,20);

    connect(ui->bt,SIGNAL(clicked()),this,SLOT(my_slot()));



}
void MainWindow::my_slot() {

    QString number=ui->lineEdit1->text();
    QString  password=ui->lineEdit2->text();
    if(number == "111111"&& password=="000000")
    {
        QMessageBox::information(this,"提示","登陆成功");
        this->close();
    }else {
                QMessageBox::information(this,"提示","手机号或密码输入错误");
                ui->lineEdit1->clear();
                 ui->lineEdit2->clear();

    }

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值