[Qt-interest] the problem of QProgressDialog & QProgressBar

Malyushytsky, Alex alex at wai.com
Mon Jul 13 23:58:26 CEST 2009


Why you don't use modal QProgressDialog dialog with setWindowModality(Qt::WindowModal), as in QT documentation?
http://doc.trolltech.com/4.3/qprogressdialog.html#details

According to my impression you should not have used show() and close() in modeless form. Just follow the example in documentation.

Regards,
    Alex


From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Gan Xiebin
Sent: Monday, July 13, 2009 1:23 AM
To: qt-interest
Subject: Re: [Qt-interest] the problem of QProgressDialog & QProgressBar


I'm sorry that I did not use plain text format.

Let me restate my question.

I have a code where call QProgressDialg as follows.

QProgressDialog progressDlg("Progress", "Cancel", 0, 100, this);

progressDlg.show(); //Calling this here only shows the title bar, no button and label. Why?
// progressDlg.exec(); Can not call this here, because the next step will never be executed.
// Unless there's a non blocking call to exec.

myFunction() ; // Do something here and show the result text to a dialogue

progressDlg->setValue(progressDlg->maximum());
progressDlg->close();

How can I make this progress dialog show itself completly without calling the exec()?
I read the document about progress bar and dialog,
and can not find out the answer.

Any idea?
Thank you.




How can I make this progress dialog show itself completly without calling the exec()?

I read the document about the progress bar and dialog,

and can not find out the answer.

Thank you.




---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list