[英]Qt Login Timeout Using QTimer
I am trying to implement a login timeout when the username/password has been entered wrong too many time. 当用户名/密码输入错误时间过多时,我正在尝试实现登录超时。 But i am unable to do so. 但是我做不到。 My code is below 我的代码如下
ui->label->setText("Password entered wrong too many times, entered 10 minute cooldown period");
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(6000);
ui->pushButton->setVisible(false);
if(!timer->isActive())
ui->pushButton->setVisible(true);
Try this 尝试这个
ui->pushButton->hide();
QTimer::singleShot(5000, ui->pushButton, SLOT(show()));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.