MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / runWorker

Method runWorker

apps/modeler/src/thread_controller.cpp:55–84  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

53
54//////////////////////////////////////////////////////////////////////////////////////////////
55bool
56pcl::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//////////////////////////////////////////////////////////////////////////////////////////////
87void

Calls 4

getInstanceFunction · 0.85
slotOnWorkerStartedMethod · 0.80
execMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected