[Qt-interest] Can't i use progressBar->hide() andprogressBar->show() in same block of code ?

Scott Aron Bloom Scott.Bloom at sabgroup.com
Thu May 28 07:10:50 CEST 2009


You don't have an eventloop running, call process events  inside your
loop...

 

Scot

 

From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Usman Ajmal
Sent: Wednesday, May 27, 2009 9:47 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Can't i use progressBar->hide()
andprogressBar->show() in same block of code ?

 

Hi again...

Whenever i use progressBar->hide() and progressBar->show() is same block
of code, the hide() seems to have overide the show() function and
therefore i don't see any progress bar busy indicator.

What i am doing is that i first show the busy indicator then i perform
my operation which takes about 2-3 minutes. After the operation
completes i wanted to hide the bar.

But i not getting the required functionality. Is it because qmake is a
compiler, not an interpretor so it sees the progressBar->hile() only
that comes at the end of code.

Following is the code:

    progressBar->show();
    QObject *parent;
    QString program = "dd if=/dev/mem of= of=/home/dump.dt"
    
    QProcess *myProcess= new QProcess(parent);
    myProcess->start(program);
            
    while (myProcess->waitForFinished()) {
            
     }
    progressBar->hide();

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090527/7176db39/attachment.html 


More information about the Qt-interest-old mailing list