timer->stop();timer->stop();用定时器不傻。可以改进一下:
connect(LineEdit, SIGNAL(textChanged(const QString &), this, SLOT(sltDsplyLast(const QString &)));
connect(timer, SIGNAL(timeout()), this, SLOT(sltDsplyStar()));
timer->setInterval(2000);
在槽sltDsplyLast(const QString &)中,
timer->stop();
显示最后一个字符,其他显示星号;
然后timer->start();
在槽sltDsplyStar()中,
timer->stop();
全部显示星号