1、示例代碼
1
QtCore.QTimer.singleShot(self.delaySpinBox.value() * 1000,
2
self.shootScreen)
QtCore.QTimer.singleShot(self.delaySpinBox.value() * 1000,2
self.shootScreen)2、關于QTimer.singleShot 的用法
void QTimer::singleShot ( int msec, QObject * receiver, const char * member ) [static]
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.
Example:
This sample program automatically terminates after 10 minutes (600,000 milliseconds).
The receiver is the receiving object and the member is the slot. The time interval is msec milliseconds.
Note: This function is reentrant.
See also setSingleShot() and start().


