33 #include <QtCore/QCoreApplication> 
   34 #include <QtGui/QApplication> 
   35 #include <QtGui/QCloseEvent> 
   36 #include <QtGui/QScrollBar> 
   39   : QDialog(parent, Qt::Tool),
 
   40     AbstractProgressViewer()
 
   66   m_tasks.insert(std::map<int, te::common::TaskProgress*>::value_type(
id, t));
 
   69   QCoreApplication::processEvents();
 
   74   std::map<int, te::common::TaskProgress*>::iterator it = m_tasks.find(taskId);
 
   76   if(it != m_tasks.end())
 
   81   QCoreApplication::processEvents();
 
   95   std::map<int, te::common::TaskProgress*>::iterator it = m_tasks.find(taskId);
 
   97   if(it != m_tasks.end())
 
   99     std::map<int, te::qt::widgets::ProgressWidgetItem*>::iterator itItem = m_items.find(taskId);
 
  101     if(itItem != m_items.end())
 
  103       itItem->second->setValue(it->second->getProportionalValue());
 
  110   std::map<int, te::common::TaskProgress*>::iterator it = m_tasks.find(taskId);
 
  112   if(it != m_tasks.end())
 
  114     std::map<int, te::qt::widgets::ProgressWidgetItem*>::iterator itItem = m_items.find(taskId);
 
  116     if(itItem != m_items.end())
 
  118       itItem->second->setLabel(it->second->getMessage());
 
  133     m_items.insert(std::map<int, ProgressWidgetItem*>::value_type(createEvent->
m_taskId, item));
 
  135     connect(item, SIGNAL(taskCanceled(
int)), 
this, SLOT(cancel(
int)));
 
  137     m_widgetLayout->addWidget(item);
 
  148     std::map<int, te::qt::widgets::ProgressWidgetItem*>::iterator itItem = m_items.find(removeEvent->
m_taskId);
 
  149     if(itItem == m_items.end())
 
  152     delete itItem->second;
 
  153     m_items.erase(itItem);
 
  159   std::map<int, te::common::TaskProgress*>::iterator itTask = m_tasks.find(
id);
 
  161   if(itTask != m_tasks.end())
 
  163     itTask->second->cancel();
 
A class that defines the interface of a qt widget to group a set of ProgressWidgetItem. 
 
The CreateProgressWidgetItemEvent is a custom event used to create a progress widget item...
 
QWidget * m_widget
GUI Objects used to build the custom widget. 
 
virtual void updateMessage(int taskId)
Update the progress message. 
 
static QEvent::Type type()
Get the custom event type. 
 
int m_totalSteps
The total steps of progress widget that will be created. 
 
The RemoveProgressWidgetItemEvent is a custom event used to remove a progress widget item...
 
static QEvent::Type type()
Get the custom event type. 
 
int getTotalSteps() const 
Get the task total stepes. 
 
The RemoveProgressWidgetItem is a custom event used to remove a progress widget item. 
 
virtual void removeTask(int taskId)
Removes a task from progress viewer container. 
 
virtual void cancelTask(int taskId)
Cancel a task. 
 
Custom widget used to represent a single task. 
 
const std::string & getMessage() const 
Get the task message. 
 
virtual void addTask(te::common::TaskProgress *t, int id)
Insert a new taks to progress viewer container. 
 
QGridLayout * m_MainLayout
GUI Objects used to build the custom widget. 
 
virtual void updateValue(int taskId)
Update the progress evaluation. 
 
QScrollArea * m_scroll
GUI Objects used to build the custom widget. 
 
int m_taskId
The task id associated with the progress widget that will be created. 
 
void customEvent(QEvent *e)
Used to receive custom progress events. 
 
virtual void setLabel(const std::string &message)
Set the progress label information. 
 
virtual ~ProgressViewerWidget()
Virtual destructor. 
 
void cancel(int id)
This slot is connect to all cancel buttons of each progress items. 
 
Custom widget used to represent a single task. 
 
This class can be used to inform the progress of a task. 
 
QGridLayout * m_widgetLayout
GUI Objects used to build the custom widget. 
 
int m_taskId
The task id associated with the progress widget that will be removed. 
 
virtual void setTotalValues(int taskId)
Set task total steps. 
 
QString m_label
Progress widget item label. 
 
The CreateProgressWidgetItemEvent is a custom event used to create a progress widget item...
 
ProgressViewerWidget(QWidget *parent)
Default constructor.