Пример #1
0
 void	ThreadPool::addTask(ThreadTask* task)
 {
   QMutexLocker locker(&_mutex);
   _nbTaskTotal.ref();
   _queue.enqueue(task);
   newTask();
   calcPercent();
 }
Пример #2
0
    ThreadTask* ThreadPool::getNextTask()
    {
      QMutexLocker locker(&_mutex);
      if (_queue.empty())
	{
	  return (NULL);
	}
      _nbTaskDone.ref();
      calcPercent();
      return (_queue.dequeue());
    }
Пример #3
0
// set a new current iteration & update display
void TProgressBar::setCurIter ( unsigned long newCur )
{
    curIter = newCur;
 
    calcPercent();
 
	 // width change?
	 if ( curPercent != oldPercent )
	 {
		  drawView();                       // paint the thermometer bar
	 }
}
Пример #4
0
// set a new current iteration & update display
void TProgressBar::setProgress(unsigned long newProgress) {
   progress = newProgress;
   calcPercent();
   drawView();                       // paint the thermometer bar
}
Пример #5
0
void TProgressBar::update(unsigned long aProgress) {
   progress = aProgress;
   calcPercent();
   drawView();
}