Fix an issue with QTimer.singleShot