Signals | Public Member Functions | Protected Slots

QmitkProgressBar Class Reference

QT-Toolkit/GUI dependent class that provides the QT's ProgressBar. More...

#include <QmitkProgressBar.h>

Inheritance diagram for QmitkProgressBar:
Inheritance graph
[legend]
Collaboration diagram for QmitkProgressBar:
Collaboration graph
[legend]

List of all members.

Signals

void SignalAddStepsToDo (unsigned int steps)
void SignalProgress (unsigned int steps)
void SignalSetPercentageVisible (bool visible)

Public Member Functions

 QmitkProgressBar (QWidget *parent=0, const char *name=0)
 Constructor; holds param instance internally and connects this to the mitkProgressBar.
virtual ~QmitkProgressBar ()
 Destructor.
virtual void SetPercentageVisible (bool visible)
 Sets whether the current progress value is displayed.
virtual void AddStepsToDo (unsigned int steps)
 Adds steps to totalSteps.
virtual void Progress (unsigned int steps)
 Sets the current amount of progress to current progress + steps.

Protected Slots

virtual void SlotAddStepsToDo (unsigned int steps)
virtual void SlotProgress (unsigned int steps)
virtual void SlotSetPercentageVisible (bool visible)

Detailed Description

QT-Toolkit/GUI dependent class that provides the QT's ProgressBar.

All mitk-classes will call this class for output: mitk::ProgressBar::GetInstance();

Definition at line 31 of file QmitkProgressBar.h.


Constructor & Destructor Documentation

QmitkProgressBar::QmitkProgressBar ( QWidget *  parent = 0,
const char *  name = 0 
)

Constructor; holds param instance internally and connects this to the mitkProgressBar.

Definition at line 66 of file QmitkProgressBar.cpp.

References mitk::ProgressBar::SetImplementationInstance(), SetPercentageVisible(), SignalAddStepsToDo(), SignalProgress(), SignalSetPercentageVisible(), SlotAddStepsToDo(), SlotProgress(), and SlotSetPercentageVisible().

:QProgressBar(parent), ProgressBarImplementation()
{
  m_TotalSteps = 0; m_Progress = 0;
  this->hide();
  this->SetPercentageVisible(true);

  connect( this, SIGNAL(SignalAddStepsToDo(unsigned int)), this, SLOT(SlotAddStepsToDo(unsigned int)) );
  connect( this, SIGNAL(SignalProgress(unsigned int)), this, SLOT(SlotProgress(unsigned int)) );
  connect( this, SIGNAL(SignalSetPercentageVisible(bool)), this, SLOT(SlotSetPercentageVisible(bool)) );

  mitk::ProgressBar::SetImplementationInstance(this);
}
QmitkProgressBar::~QmitkProgressBar (  ) [virtual]

Destructor.

Definition at line 80 of file QmitkProgressBar.cpp.

{
}

Member Function Documentation

void QmitkProgressBar::AddStepsToDo ( unsigned int  steps ) [virtual]

Adds steps to totalSteps.

Documentation

Implements mitk::ProgressBarImplementation.

Definition at line 50 of file QmitkProgressBar.cpp.

References SignalAddStepsToDo().

{
  emit SignalAddStepsToDo(steps);
}
void QmitkProgressBar::Progress ( unsigned int  steps ) [virtual]

Sets the current amount of progress to current progress + steps.

Parameters:
steps the number of steps done since last Progress(int steps) call.

Documentation

Parameters:
stepsthe number of steps done since last Progress(int steps) call.

Implements mitk::ProgressBarImplementation.

Definition at line 60 of file QmitkProgressBar.cpp.

References SignalProgress().

{
  emit SignalProgress(steps);
}
void QmitkProgressBar::SetPercentageVisible ( bool  visible ) [virtual]

Sets whether the current progress value is displayed.

Implements mitk::ProgressBarImplementation.

Definition at line 41 of file QmitkProgressBar.cpp.

References SignalSetPercentageVisible().

Referenced by QmitkProgressBar().

{
  emit SignalSetPercentageVisible(visible);
}
void QmitkProgressBar::SignalAddStepsToDo ( unsigned int  steps ) [signal]

Referenced by AddStepsToDo(), and QmitkProgressBar().

void QmitkProgressBar::SignalProgress ( unsigned int  steps ) [signal]

Referenced by Progress(), and QmitkProgressBar().

void QmitkProgressBar::SignalSetPercentageVisible ( bool  visible ) [signal]
void QmitkProgressBar::SlotAddStepsToDo ( unsigned int  steps ) [protected, virtual, slot]

Definition at line 102 of file QmitkProgressBar.cpp.

References mitk::RenderingManager::GetInstance().

Referenced by QmitkProgressBar().

{
  m_TotalSteps += steps;
  this->setMaximum(m_TotalSteps);
  this->setValue(m_Progress);
  if (m_TotalSteps > 0)
  {
    this->show();
  }

  // Update views if repaint has been requested in the meanwhile
  // (because Qt event loop is not reached while progress bar is updating,
  // unless the application is threaded)
  mitk::RenderingManager::GetInstance()->ExecutePendingRequests();
}
void QmitkProgressBar::SlotProgress ( unsigned int  steps ) [protected, virtual, slot]

Definition at line 84 of file QmitkProgressBar.cpp.

References mitk::RenderingManager::GetInstance().

Referenced by QmitkProgressBar().

{
  m_Progress += steps;
  this->setValue(m_Progress);

  if (m_Progress >= m_TotalSteps)
    Reset();
  else
  {
     this->show();
  }

  // Update views if repaint has been requested in the meanwhile
  // (because Qt event loop is not reached while progress bar is updating,
  // unless the application is threaded)
  mitk::RenderingManager::GetInstance()->ExecutePendingRequests();
}
void QmitkProgressBar::SlotSetPercentageVisible ( bool  visible ) [protected, virtual, slot]

Definition at line 118 of file QmitkProgressBar.cpp.

Referenced by QmitkProgressBar().

{
  this->setTextVisible(visible);
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines