QThread::setTerminationEnabled(true);
void longprocess::run(){ while (flagRun) { //кеккеикикикекеноер }}void longprocess::stop(){ flagRun = 0}
void longprocess::run(){ //some code if(needStop == true) return; //some code if(needStop == true) return; while (i>0) { qDebug() << needStop; if(needStop == true) return; //some code if(needStop == true) return; }}void longprocess::stop(){ needStop = true;}
if (needStop == true)// вместоif (needStop)
C++ (Qt)void longprocess::run(){ neetStop = false; //some code ...}