QProgressDialog and forceShow(), how to use this protected member?
Hello, i got a problem with QProgressDialog, i'd like to show quickly the QProgressDialog but i get this error:
Code:
/usr
/local
/Trolltech
/Qt
-4.3.2
-commercial
-static/include
/QtGui
/qprogressdialog.
h:101: error
: ‘
void QProgressDialog::forceShow()’ is
protected
here down the code
Code:
QProgressDialog progress
( tr
( "Sending configuration..." ) , tr
( "Abort" ) ,
0 , commandNumber ,
this );
progress.setWindowTitle ( tr ( "Sending configuration..." ) );
progress.setWindowModality ( Qt::NonModal );
progress.setMinimumDuration(0);
progress.forceShow(); // <-- error forceShow() is protected
thx
Re: QProgressDialog and forceShow(), how to use this protected member?
That's right, it's protected and not intended to be called like that. Did you read what QProgressDialog::forceShow() does? Just set minimum duration to 0.
Re: QProgressDialog and forceShow(), how to use this protected member?
ok I read, but my bar isn't showed, i post whole the code, maybe i have some error in
Code:
QProgressDialog progress
( tr
( "Sending configuration..." ) , tr
( "Abort" ) ,
0 , commandNumber ,
this );
progress.setWindowTitle ( tr ( "Sending configuration..." ) );
progress.setWindowModality ( Qt::NonModal );
progress.setMinimumDuration(0);
for ( int i=0 ; i < commandNumber ; i++ )
{
// set the progress bar
progress.setValue ( i );
// check if user choose to abort operation
if ( progress.wasCanceled () )
{
return false;
}
}
progress.setValue ( commandNumber );
edit:
i checked again, it works ;)