[Qt-interest] bring a progressdialog in front of a qfiledialog

Yifei Li yifli at mtu.edu
Thu Oct 29 15:39:10 CET 2009


Thank you for the reply.

I provide more details here:
if( !file.isEmpty() )
{
    QProgressDialog progress(...);
    progress.setWindowFlags(Qt::WindowStaysOnTopHint);
    progress.raise()
   
    // read some big file
    read_big_file(myBigFileObject, file);

    // process myBigFileObject
    progress.setValue(1)
    myBigFileObject.process_step_1();

    progress.setValue(2)
    myBigFileObject.process_step_2();

    ....
        
}

Yifei
----- Original Message -----
From: "Scott Aron Bloom" <Scott.Bloom at sabgroup.com>
To: "Yifei Li" <yifli at mtu.edu>, "qt-interest" <qt-interest at trolltech.com>
Sent: Wednesday, October 28, 2009 2:47:20 PM GMT -05:00 US/Canada Eastern
Subject: RE: [Qt-interest] bring a progressdialog in front of a qfiledialog

Yes I can help you with this... Will I ?  that is the question...

The moment your QProgressDialog goes out of scope.. it will close.

So what is going on in your "...." is very important.

It needs to be some sort of event loop so it will stay in that area
until what ever you are doing is done

Scott

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Yifei Li
Sent: Wednesday, October 28, 2009 11:38 AM
To: qt-interest
Subject: [Qt-interest] bring a progressdialog in front of a qfiledialog

Hi all,

I want to show a progressdialog immediately after I hit 'Open'. I tried
BOTH modal and modaless qfiledialg, but still can't bring the
progressdialog to the front. The progressdialog only flashed after the
qfiledialog is closed.

Here is what I did:

file = QFileDialog::getOpenFileName(...);

if( !file.isEmpty() )
{
    QProgressDialog progress(...);
    progress.setWindowFlags(Qt::WindowStaysOnTopHint);
    progress.raise()
    ....
}


Can anyone help me with this? Thanks

Yifei
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list