Commit 71e66d87 authored by Mike Kremer's avatar Mike Kremer
Browse files

Added some comments on how to correctly use the OpenFlipperThread::state() signal.

git-svn-id: 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cfde7c31
......@@ -250,6 +250,17 @@ A quick example for stating a thread:
thread->start(); // start thread
thread->startProcessing(); // start processing
Note: If your class is derived from OpenFlipperThread and reimplements the
run() function, you might also want to connect the signal OpenFlipperThread::state()
to the plugin's signal setJobState():
connect(thread, SIGNAL(state(QString, int)), this, SIGNAL(setJobState(QString, int)));
Use signal OpenFlipperThread::state() within your run() function in order to
correctly update the job's state.
......@@ -90,7 +90,8 @@ class DLLEXPORT OpenFlipperThread : public QThread
/** \brief Main processing
* Either reimplement this function or connect the function()
* signal.
* signal. If this function is reimplemented, use signal state()
* in order to inform the core about the job's current state.
virtual void run();
......@@ -115,8 +116,11 @@ class DLLEXPORT OpenFlipperThread : public QThread
/** \brief Tell core about job state
* Emit this signal to tell the core about your job status. You have to create a new run function for
* this. In simple mode, this signal is not emitted at all!
* Use this signal to inform core about the job's state if and
* only if the thread class inherits from OpenFlipperThread
* and the virtual run() function is overridden. In all other cases
* this signal won't be used and does not have to be connected to from
* within the plugins.
void state( QString _jobId, int _state );
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment