QEventLoop eloop
;
QTimer
::singleShot(10000, &eloop
, SLOT(quit()));
eloop
.exec();
[static] void QTimer
::singleShot(int msec
, const QObject
*receiver
, const char *member
)
This
static function calls a slot after a given time interval
.
It is very convenient to use
this function because you
do not need to bother with a timerEvent
or create a local QTimer object
.
这个静态函数在给定的时间间隔后调用一个槽。 使用此函数非常方便,因此您不需要为timerEvent或创建本地QTimer对象而烦恼。