I use a QtConcurrence to run a function in a separated thread but I want to stop, pause or kill this thread but I can't. I read this:
Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function.
Can I do this in any other way?
My function is:
void MainWindow::on_imprimirButton_clicked()
{
if(filename.length() == 0){
ui->consolaBrowser->append("Error. Debe seleccionar un fichero.");
}else if(!filename.contains(".txt")){
ui->consolaBrowser->append("Fichero erroneo. Debe seleccionar un archivo de tipo G-CODE.");
}else{
imprimiendo=1;
*future= QtConcurrent::run(Imprimir,filename.toUtf8().data());
imprimiendo=0;
}
}