1 #include "ProgressBar.h"
2 #include "ObservedWidget.h"
4 #include <QProgressBar>
11 ProgressBar::ProgressBar( const QString &aText, bool aCancellable, QWidget *aParent ) :
14 qDebug() << "ProgressBar::ProgressBar( const QString &, bool, QWidget *)";
15 setWindowTitle( aText );
18 iProgress = new QProgressBar();
19 iProgress->setMinimumWidth( 200 );
20 iProgress->setMaximum( 0 );
21 iProgress->setTextVisible( false );
23 QVBoxLayout *mainLayout = new QVBoxLayout;
24 iLabel = new QLabel();
25 mainLayout->addWidget( iLabel );
26 QHBoxLayout *subLayout = new QHBoxLayout;
27 subLayout->addWidget( iProgress );
29 QPushButton *buttonCancel = new QPushButton( tr( "Cancel" ) );
30 subLayout->addSpacing( 5 );
31 subLayout->addWidget( buttonCancel );
32 connect( buttonCancel, SIGNAL( pressed() ), this, SIGNAL( cancel() ) );
35 setLayout( mainLayout );
38 ProgressBar::~ProgressBar()
40 qDebug() << "ProgressBar::~ProgressBar()";
43 void ProgressBar::update( const QString &aMessage )
45 qDebug() << "ProgressBar::update( const QString & )";
46 iLabel->setText( aMessage );