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:
QWidget 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

QPushButtonm_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...
 
int m_viewerId
 

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.

Definition at line 37 of file ProgressViewerBar.cpp.

References m_button, m_layout, m_progressBar, onReleased(), and ~ProgressViewerBar().

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

Virtual destructor.

Referenced by ProgressViewerBar().

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.

Definition at line 65 of file ProgressViewerBar.cpp.

References m_tasks.

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

Cancel a task.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Definition at line 95 of file ProgressViewerBar.cpp.

References m_currentStep, m_propStep, m_tasks, and m_totalSteps.

Referenced by removeTask().

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

Emit a signal if the button was clicked.

Referenced by onReleased().

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

Used to receive custom progress events.

Parameters
eEvent sent to this object.

Definition at line 160 of file ProgressViewerBar.cpp.

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

void te::qt::widgets::ProgressViewerBar::onReleased ( )
virtualslot

Used to get the button clicked (internal function).

Definition at line 172 of file ProgressViewerBar.cpp.

References clicked().

Referenced by ProgressViewerBar().

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

Removes a task from progress viewer container.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Definition at line 70 of file ProgressViewerBar.cpp.

References cancelTask(), m_currentStep, m_progressBar, m_propStep, m_tasks, and m_totalSteps.

void te::qt::widgets::ProgressViewerBar::setButtonText ( const std::string &  value)

Definition at line 155 of file ProgressViewerBar.cpp.

References m_button.

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

Set task total steps.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Definition at line 118 of file ProgressViewerBar.cpp.

References m_progressBar, m_tasks, and m_totalSteps.

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

Update the progress message.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Definition at line 151 of file ProgressViewerBar.cpp.

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

Update the progress evaluation.

Parameters
taskIdTask identifier

Implements te::common::AbstractProgressViewer.

Definition at line 128 of file ProgressViewerBar.cpp.

References m_propStep, m_tasks, and m_totalSteps.

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.

Referenced by ProgressViewerBar(), and setButtonText().

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.

Referenced by cancelTask(), and removeTask().

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

GUI Objects used to build the custom widget.

Definition at line 158 of file ProgressViewerBar.h.

Referenced by ProgressViewerBar().

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

GUI Objects used to build the custom widget.

Definition at line 159 of file ProgressViewerBar.h.

Referenced by customEvent(), ProgressViewerBar(), removeTask(), and setTotalValues().

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.

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

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

Task container.

Definition at line 157 of file ProgressViewerBar.h.

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

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.

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: