void ThreadPool::addTask(ThreadTask* task) { QMutexLocker locker(&_mutex); _nbTaskTotal.ref(); _queue.enqueue(task); newTask(); calcPercent(); }
ThreadTask* ThreadPool::getNextTask() { QMutexLocker locker(&_mutex); if (_queue.empty()) { return (NULL); } _nbTaskDone.ref(); calcPercent(); return (_queue.dequeue()); }
// 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 } }
// set a new current iteration & update display void TProgressBar::setProgress(unsigned long newProgress) { progress = newProgress; calcPercent(); drawView(); // paint the thermometer bar }
void TProgressBar::update(unsigned long aProgress) { progress = aProgress; calcPercent(); drawView(); }