Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Protected Attributes
ScProgressBar Class Reference

A Progress Bar that allows a number (X of Y) style or standard % indicator. More...

#include <scprogressbar.h>

List of all members.

Public Member Functions

 ScProgressBar (bool showNumbers, QWidget *parent=0, const char *name=0, WFlags f=0)
 ScProgressBar (bool showNumbers, int totalSteps, QWidget *parent=0, const char *name=0, WFlags f=0)
virtual bool setIndicator (QString &indicator, int progress, int totalSteps)
 ~ScProgressBar ()

Protected Attributes

bool m_useNumeric

Detailed Description

A Progress Bar that allows a number (X of Y) style or standard % indicator.

Definition at line 31 of file scprogressbar.h.


Constructor & Destructor Documentation

ScProgressBar::ScProgressBar ( bool  showNumbers,
QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)

Definition at line 27 of file scprogressbar.cpp.

                                                                                            :
       QProgressBar( parent, name, f ),
       m_useNumeric(showNumbers)
{
}
ScProgressBar::ScProgressBar ( bool  showNumbers,
int  totalSteps,
QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)

Definition at line 33 of file scprogressbar.cpp.

                                                                                                            :
       QProgressBar( totalSteps, parent, name, f ),
       m_useNumeric(showNumbers)
{
}

Definition at line 40 of file scprogressbar.cpp.

{
}

Member Function Documentation

bool ScProgressBar::setIndicator ( QString &  indicator,
int  progress,
int  totalSteps 
) [virtual]

Definition at line 44 of file scprogressbar.cpp.

{
       if ( !totalSteps )
              return FALSE;
       if ( progress < 0 ) {
              indicator = QString::fromLatin1("");
              return TRUE;
       } else {
              if (!m_useNumeric)
                     return QProgressBar::setIndicator(indicator, progress, totalSteps);
              else
              {
                     indicator = tr("%1 of %2").arg(progress).arg(totalSteps);
                     return true;
              }
       }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 43 of file scprogressbar.h.


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