te::qt::widgets::ProgressViewerBar Class Reference

A class that defines the interface of a qt bar progress viewer. More...

#include <ProgressViewerBar.h>

Inheritance diagram for te::qt::widgets::ProgressViewerBar:
te::common::AbstractProgressViewer

Public Slots

virtual void onReleased ()
 Used to get the button clicked (internal function). More...
 

Signals

void clicked ()
 Emit a signal if the button was clicked. 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...
 
 ProgressViewerBar (QWidget *parent)
 Default constructor. More...
 
void removeTask (int taskId)
 Removes a task from progress viewer container. More...
 
void setButtonText (const std::string &value)
 
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...
 
 ~ProgressViewerBar ()
 Virtual destructor. More...
 

Protected Member Functions

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

Protected Attributes

QPushButton * m_button
 GUI Objects used to build the custom widget. More...
 
int m_currentStep
 Attribute used to define the current steps of all task. More...
 
QGridLayout * m_layout
 GUI Objects used to build the custom widget. More...
 
QProgressBar * m_progressBar
 GUI Objects used to build the custom widget. 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...
 

Detailed Description

A class that defines the interface of a qt bar progress viewer.

It can be use inside a status bar.

This viewer is made using QtProgressBar object. Feed back will be generated over a custom widget. Multiples tasks will be displayed using ONLY one progress.

The proportional value is calculated using TOTALSTEPS / CURRENTSTEPS.

TOTALSTEPS - Sum of all total steps of all tasks CURRENTSTEPS - Sum of all current steps of all tasks

This viwer does NOT have message information. A Qt Button objected has located at the right side of the bar. The button clicked can be accessed getting clicked() signal.

See also
AbstractProgressViewer, QtProgressBar
Note
In this viewer, tasks can NOT be deleted.

Definition at line 76 of file ProgressViewerBar.h.

Constructor & Destructor Documentation

te::qt::widgets::ProgressViewerBar::ProgressViewerBar ( QWidget *  parent)

Default constructor.

te::qt::widgets::ProgressViewerBar::~ProgressViewerBar ( )

Virtual destructor.

Member Function Documentation

void te::qt::widgets::ProgressViewerBar::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.

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

Cancel a task.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

void te::qt::widgets::ProgressViewerBar::clicked ( )
signal

Emit a signal if the button was clicked.

virtual void te::qt::widgets::ProgressViewerBar::customEvent ( QEvent *  e)
protectedvirtual

Used to receive custom progress events.

Parameters
eEvent sent to this object.
virtual void te::qt::widgets::ProgressViewerBar::onReleased ( )
virtualslot

Used to get the button clicked (internal function).

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

Removes a task from progress viewer container.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

void te::qt::widgets::ProgressViewerBar::setButtonText ( const std::string &  value)
void te::qt::widgets::ProgressViewerBar::setTotalValues ( int  taskId)
virtual

Set task total steps.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

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

Update the progress message.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

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

Update the progress evaluation.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Member Data Documentation

QPushButton* te::qt::widgets::ProgressViewerBar::m_button
protected

GUI Objects used to build the custom widget.

Definition at line 160 of file ProgressViewerBar.h.

int te::qt::widgets::ProgressViewerBar::m_currentStep
protected

Attribute used to define the current steps of all task.

Definition at line 155 of file ProgressViewerBar.h.

QGridLayout* te::qt::widgets::ProgressViewerBar::m_layout
protected

GUI Objects used to build the custom widget.

Definition at line 158 of file ProgressViewerBar.h.

QProgressBar* te::qt::widgets::ProgressViewerBar::m_progressBar
protected

GUI Objects used to build the custom widget.

Definition at line 159 of file ProgressViewerBar.h.

int te::qt::widgets::ProgressViewerBar::m_propStep
protected

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

Definition at line 156 of file ProgressViewerBar.h.

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

Task container.

Definition at line 157 of file ProgressViewerBar.h.

int te::qt::widgets::ProgressViewerBar::m_totalSteps
protected

Attribute used to define the total steps of all tasks.

Definition at line 154 of file ProgressViewerBar.h.


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