Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
campvis-public
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CAMP
campvis-public
Commits
11f1805e
Commit
11f1805e
authored
Sep 30, 2014
by
CAMP C++ Builder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QtJobProcessor doc / cleanup
parent
1f8a8832
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
application/qtjobprocessor.cpp
application/qtjobprocessor.cpp
+0
-2
application/qtjobprocessor.h
application/qtjobprocessor.h
+17
-1
No files found.
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
Markdown
is supported
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