6.18啊啊啊啊啊啊啊啊啊

#include "second.h"
#include "ui_second.h"

Second::Second(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Second),
    speech(new QTextToSpeech(this))

{
    ui->setupUi(this);





}


void Second::my_jump()
{
    show();


}
 void Second::timerEvent(QTimerEvent *e)//重写定时器事件的实现
 {
     QTime s=QTime::currentTime();
     QString t=s.toString("hh::mm::ss");
     if(e->timerId()==id)
     {
//     QTime s=QTime::currentTime();
//     QString t=s.toString("hh::mm::ss");
    ui->label->setText(t);
    ui->label->setAlignment(Qt::AlignCenter);

 }else if(e->timerId()==id1)
     {
         if(t==ui->lineEdit->text())
         {
             ui->label_3->setText("你这个年龄段振不到刀,你怎么睡的着的");
             speech->say(ui->label_3->text());
             //QUrl source(QUrl::fromLocalFile());
         }

     }






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



void Second::on_pushButton_clicked()
{
    if(ui->pushButton->text()=="启动")
    {





        ui->pushButton->setText("关闭");

    }
    else{

        killTimer(id);
        killTimer(id1);
        ui->pushButton->setText("启动");
    }
}
#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowFlag(Qt::FramelessWindowHint);//去掉头部
    this->setAttribute(Qt::WA_TranslucentBackground);

}

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


void Widget::on_btn2_clicked()
{
   QMessageBox msg(QMessageBox::Question,"问题","您是否确定退出登录?",QMessageBox::Yes|QMessageBox::No,this);
   int ret=msg.exec();
   if(ret==QMessageBox::Yes)
   {
       close();
   }
   else
   {
       msg.close();
   }

}

void Widget::on_btn1_clicked()
{

    QString a=ui->lineEdit->text();
    QString b=ui->lineEdit_2->text();
    if(a=="admin"&&b=="123456")
    {
        int ret=QMessageBox::information(this,"信息","登录成功",QMessageBox::Ok);
        if(ret==QMessageBox::Ok)
        {
            close();
              emit my_signal();
        }


    }
    else{
        int ret1=QMessageBox::warning(this,"错误","账号密码不匹配,是否重新登录",QMessageBox::Yes|QMessageBox::No);
        if(ret1==QMessageBox::Yes)
        {
            ui->lineEdit_2->clear();
        }
        else{
            close();
        }

    }

}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值