#include “widget.h”
#include “ui_widget.h”
Widget::~Widget()
{
delete ui;
}
void Widget::on_btn1_clicked()
{
if(“启动” == ui->btn1->text())
{
//启动一个定时器
t->start(1000);
}
}
void Widget::on_btn2_clicked()
{
if(“停止” == ui->btn2->text())
{
killTimer(tId);
speecher->stop();
}
}
void Widget::timeout_Slot()
{
QTime sys_tem = QTime::currentTime();
QString s = sys_tem.toString("hh:mm:ss");
ui->lab1->setText(s);
ui->lab1->setAlignment(Qt::AlignCenter);
QString clock = ui->text->text();
if (clock == ui->lab1->text())
{
int i = 0;
while(i < 20)
{
i++;
speecher->say(ui->lab2->text());
}
}
}