C++ (Qt)uThread::uThread(int vTime, QString vFile) : cntTime( vTime ), sFile( vFile ){ moveToThread( this );} void uThread::run(){ QTimer timer; connect( &timer, SIGNAL( timeout() ), SLOT( slotWriteFile() ) ); timer.start( cntTime * 1000 ); exec();}