1 //-----------------------------------------------------------------------------
2 // This file is a part of the Qarte software.
4 // \file uiProgressQt.cpp
5 // \author Benoit Autheman (benoit@libqanava.org)
7 //-----------------------------------------------------------------------------
11 #include "uiProgressQt.h"
14 namespace qan
{ // ::qan
15 namespace qui
{ // ::qan::qui
18 /* Progress Constructor/Destructor *///----------------------------------------
19 ProgressQt::ProgressQt( QWidget
* widget
, int maxProgress
) :
20 qan::utl::Progress( maxProgress
),
23 // Setup progress dialog (Maximum is set to 100, since updateProgress() is called
24 // directly in percents)
25 _progress
= new QProgressDialog( "Processing...", "Abort", 100,
26 widget
, "progress", TRUE
);
27 _progress
->setMinimumDuration( 0 );
28 _progress
->setProgress( 0 );
31 ProgressQt::~ProgressQt( )
36 //-----------------------------------------------------------------------------
40 /* Views Management *///-------------------------------------------------------
41 bool ProgressQt::getCancel( )
44 return _progress
->wasCancelled( );
48 void ProgressQt::updateProgress( int percent
)
50 _progress
->setProgress( percent
);
52 //-----------------------------------------------------------------------------