te::qt::widgets::ProgressViewerDialog Class Reference

A progress dialog. More...

#include <ProgressViewerDialog.h>

Inheritance diagram for te::qt::widgets::ProgressViewerDialog:
QObject te::common::AbstractProgressViewer

Public Slots

virtual void cancel ()
 Get the button clicked and cancel ALL tasks. More...
 

Public Member Functions

void addTask (te::common::TaskProgress *t, int id)
 Insert a new taks to progress viewer container. More...
 
void cancelTask (int taskId)
 Cancel a task. More...
 
 ProgressViewerDialog (QWidget *parent, QString title="")
 Default constructor. More...
 
void removeTask (int taskId)
 Removes a task from progress viewer container. More...
 
void setTitle (QString title)
 Set title to dialog. More...
 
void setTotalValues (int taskId)
 Set task total steps. More...
 
void updateMessage (int taskId)
 Update the progress message. More...
 
void updateValue (int taskId)
 Update the progress evaluation. More...
 
 ~ProgressViewerDialog ()
 Virtual destructor. More...
 

Protected Member Functions

virtual void customEvent (QEvent *e)
 Used to receive custom progress events. More...
 

Protected Attributes

int m_currentStep
 Attribute used to define the current steps of all task. More...
 
QProgressDialog * m_dlgProgress
 GUI Objects used as progress bar dialog. More...
 
std::string m_message
 Attribute used to define dialog message. More...
 
int m_propStep
 Attribute used to define the proportional step (0-100). More...
 
std::map< int, te::common::TaskProgress * > m_tasks
 Task container. More...
 
int m_totalSteps
 Attribute used to define the total steps of all tasks. More...
 
int m_viewerId
 

Detailed Description

A progress dialog.

This widget is a dialog with progress information and a cancel button.

This viewer is made using Qt Progress Dialog. Feed back will be generated over a dialog window. Multiples tasks will be displayed using ONLY one progress.

The proportional value is calculated using TOTALSTEPS / CURRENTSTEPS, where:

  • TOTALSTEPS: Sum of all total steps of all tasks
  • CURRENTSTEPS: Sum of all current steps of all tasks

The progress message is defined by the task message, if it has more than on task the message will be "MULTI TASKS".

Definition at line 72 of file ProgressViewerDialog.h.

Constructor & Destructor Documentation

te::qt::widgets::ProgressViewerDialog::ProgressViewerDialog ( QWidget parent,
QString  title = "" 
)

Default constructor.

Definition at line 37 of file ProgressViewerDialog.cpp.

References cancel(), and m_dlgProgress.

te::qt::widgets::ProgressViewerDialog::~ProgressViewerDialog ( )

Virtual destructor.

Definition at line 53 of file ProgressViewerDialog.cpp.

References m_dlgProgress.

Member Function Documentation

void te::qt::widgets::ProgressViewerDialog::addTask ( te::common::TaskProgress t,
int  id 
)
virtual

Insert a new taks to progress viewer container.

Parameters
tTask pointer.
idTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 58 of file ProgressViewerDialog.cpp.

References m_tasks, and updateMessage().

void te::qt::widgets::ProgressViewerDialog::cancel ( )
virtualslot

Get the button clicked and cancel ALL tasks.

Definition at line 190 of file ProgressViewerDialog.cpp.

References m_tasks.

Referenced by ProgressViewerDialog().

void te::qt::widgets::ProgressViewerDialog::cancelTask ( int  taskId)
virtual

Cancel a task.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 91 of file ProgressViewerDialog.cpp.

References m_currentStep, m_propStep, m_tasks, and m_totalSteps.

Referenced by removeTask().

void te::qt::widgets::ProgressViewerDialog::customEvent ( QEvent e)
protectedvirtual

Used to receive custom progress events.

Parameters
eEvent sent to this object.

Definition at line 170 of file ProgressViewerDialog.cpp.

References m_dlgProgress, te::qt::widgets::ProgressResetEvent::type(), te::qt::widgets::ProgressSetValueEvent::type(), and te::qt::widgets::ProgressSetMessageEvent::type().

void te::qt::widgets::ProgressViewerDialog::removeTask ( int  taskId)
virtual

Removes a task from progress viewer container.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 65 of file ProgressViewerDialog.cpp.

References cancelTask(), m_currentStep, m_dlgProgress, m_propStep, m_tasks, m_totalSteps, and updateMessage().

void te::qt::widgets::ProgressViewerDialog::setTitle ( QString  title)

Set title to dialog.

Parameters
titleA QString title.

Definition at line 124 of file ProgressViewerDialog.cpp.

References m_dlgProgress.

void te::qt::widgets::ProgressViewerDialog::setTotalValues ( int  taskId)
virtual

Set task total steps.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 114 of file ProgressViewerDialog.cpp.

References m_dlgProgress, m_tasks, and m_totalSteps.

void te::qt::widgets::ProgressViewerDialog::updateMessage ( int  taskId)
virtual

Update the progress message.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 154 of file ProgressViewerDialog.cpp.

References m_message, m_tasks, and TE_TR.

Referenced by addTask(), and removeTask().

void te::qt::widgets::ProgressViewerDialog::updateValue ( int  taskId)
virtual

Update the progress evaluation.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Definition at line 129 of file ProgressViewerDialog.cpp.

References m_propStep, m_tasks, and m_totalSteps.

Member Data Documentation

int te::qt::widgets::ProgressViewerDialog::m_currentStep
protected

Attribute used to define the current steps of all task.

Definition at line 151 of file ProgressViewerDialog.h.

Referenced by cancelTask(), and removeTask().

QProgressDialog* te::qt::widgets::ProgressViewerDialog::m_dlgProgress
protected

GUI Objects used as progress bar dialog.

Definition at line 155 of file ProgressViewerDialog.h.

Referenced by customEvent(), ProgressViewerDialog(), removeTask(), setTitle(), setTotalValues(), and ~ProgressViewerDialog().

std::string te::qt::widgets::ProgressViewerDialog::m_message
protected

Attribute used to define dialog message.

Definition at line 153 of file ProgressViewerDialog.h.

Referenced by updateMessage().

int te::qt::widgets::ProgressViewerDialog::m_propStep
protected

Attribute used to define the proportional step (0-100).

Definition at line 152 of file ProgressViewerDialog.h.

Referenced by cancelTask(), removeTask(), and updateValue().

std::map<int, te::common::TaskProgress*> te::qt::widgets::ProgressViewerDialog::m_tasks
protected

Task container.

Definition at line 154 of file ProgressViewerDialog.h.

Referenced by addTask(), cancel(), cancelTask(), removeTask(), setTotalValues(), updateMessage(), and updateValue().

int te::qt::widgets::ProgressViewerDialog::m_totalSteps
protected

Attribute used to define the total steps of all tasks.

Definition at line 150 of file ProgressViewerDialog.h.

Referenced by cancelTask(), removeTask(), setTotalValues(), and updateValue().

int te::common::AbstractProgressViewer::m_viewerId
protectedinherited

The documentation for this class was generated from the following files: