void QTimer::singleShot( int msec, QObject *receiver, const char *member ) { if ( !sst_list ) sst_init(); QSingleShotTimer *sst; if ( sst_list->isEmpty() ) { // create new ss timer sst = new QSingleShotTimer; } else { // use existing one sst = (QSingleShotTimer *)sst_list->take( 0 ); } sst->start(msec, receiver, member); }
void QTimer::singleShot( int msec, QObject *receiver, const char *member ) { if ( !sst_list ) sst_init(); // search the list for a free ss timer we could reuse QSingleShotTimer *sst = (QSingleShotTimer*)sst_list->first(); while ( sst && sst->isActive() ) sst = (QSingleShotTimer*)sst_list->next(); // create a new one if not successful if ( !sst ) { sst = new QSingleShotTimer; sst_list->append( sst ); } sst->start(msec, receiver, member); }