Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
The container registry cleanup task is now completed and the registry can be used normally.
Open sidebar
CAMP
campvis-public
Commits
11f1805e
Commit
11f1805e
authored
Sep 30, 2014
by
Jakob Weiss
Browse files
QtJobProcessor doc / cleanup
parent
1f8a8832
Changes
2
Show whitespace changes
Inline
Side-by-side
application/qtjobprocessor.cpp
View file @
11f1805e
...
...
@@ -49,8 +49,6 @@ namespace campvis {
{
tgtAssert
(
job
,
"Job must not be null!"
);
std
::
cout
<<
"Job processed."
<<
std
::
endl
;
(
*
job
)();
delete
job
;
}
...
...
application/qtjobprocessor.h
View file @
11f1805e
...
...
@@ -34,7 +34,17 @@ namespace campvis {
/**
* Job processor class for campvis
* This job processor singleton can be used to execute jobs (asynchronously) from inside the Qt GUI thread.
* This can result in simpler and better understandable code when only a few lines of code need
* to be executed in the context, as it removes the need to introduce a new signal and slot just
* to transition into the Qt GUI thread.
*
* Example:
* \code
* QtJobProc.enqueueJob([=](){
* _application->_mainWindow->statusBar()->showMessage(QString::fromStdString(status), timeout);
* });
* \endcode
*/
class
QtJobProcessor
:
public
QWidget
,
public
tgt
::
Singleton
<
QtJobProcessor
>
{
Q_OBJECT
;
...
...
@@ -45,8 +55,14 @@ namespace campvis {
virtual
~
QtJobProcessor
();
/**
Enqueues a new job to be processed by the job processor
*/
void
enqueueJob
(
AbstractJob
*
job
);
/**
Convenience function to simplify the code, removing the necessity for a makeJobOnHeap() call
*/
void
enqueueJob
(
std
::
function
<
void
(
void
)
>
fn
);
signals:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment