C++ (Qt)connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
C++ (Qt)connect(ui->pushButtonStart, SIGNAL(clicked()), thread, SLOT(terminate()));
C++ (Qt)void Thread::run{/* first work portion*/ if (stopped) return; /* second work portion*/ if (stopped) return; /* third work portion*/ if (stopped) return; .... }