Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F25859308
threadcontroller.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
threadcontroller.cpp
View Options
#include
"threadcontroller.h"
#include
"worker.h"
ThreadController
::
ThreadController
(
QObject
*
parent
)
:
QObject
(
parent
)
{
Worker
*
worker
=
new
Worker
;
worker
->
moveToThread
(
&
this
->
workerThread
);
this
->
workerThread
.
setObjectName
(
"workerThread"
);
connect
(
&
this
->
workerThread
,
SIGNAL
(
finished
()),
worker
,
SLOT
(
deleteLater
()));
connect
(
this
,
SIGNAL
(
finished
()),
&
this
->
workerThread
,
SLOT
(
quit
()));
connect
(
this
,
SIGNAL
(
finished
()),
worker
,
SLOT
(
deleteLater
()));
connect
(
this
,
SIGNAL
(
operate
(
const
QString
&
)),
worker
,
SLOT
(
doParallelAlgorithm
(
const
QString
&
)));
connect
(
worker
,
SIGNAL
(
resultReady
(
const
QString
&
)),
this
,
SLOT
(
handleResults
(
const
QString
&
)));
connect
(
&
this
->
workerThread
,
SIGNAL
(
finished
()),
this
,
SLOT
(
closeApplication
()));
this
->
workerThread
.
start
();
emit
operate
(
"doParallel Multitrheading"
);
}
ThreadController
::~
ThreadController
()
{
}
void
ThreadController
::
handleResults
(
const
QString
&
parameter
)
{
qDebug
()
<<
"Handling results"
;
qDebug
()
<<
parameter
;
emit
finished
();
}
void
ThreadController
::
closeApplication
()
{
QCoreApplication
::
quit
();
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Aug 29, 4:07 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
368980
Default Alt Text
threadcontroller.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment