/////////////////////////////////////////////////////////////////////////////////////////
| 53 | |
| 54 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 55 | bool |
| 56 | pcl::modeler::ThreadController::runWorker(AbstractWorker* worker) |
| 57 | { |
| 58 | if (worker->exec() != QDialog::Accepted) { |
| 59 | delete worker; |
| 60 | deleteLater(); |
| 61 | |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | QThread* thread = new QThread; |
| 66 | |
| 67 | connect(this, SIGNAL(prepared()), worker, SLOT(process())); |
| 68 | |
| 69 | connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater())); |
| 70 | |
| 71 | connect(worker, SIGNAL(finished()), thread, SLOT(quit())); |
| 72 | connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); |
| 73 | |
| 74 | connect(worker, SIGNAL(finished()), this, SLOT(deleteLater())); |
| 75 | |
| 76 | worker->moveToThread(thread); |
| 77 | thread->start(); |
| 78 | |
| 79 | MainWindow::getInstance().slotOnWorkerStarted(); |
| 80 | |
| 81 | emit prepared(); |
| 82 | |
| 83 | return true; |
| 84 | } |
| 85 | |
| 86 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 87 | void |
no test coverage detected