Perhaps 4.3.4 creates the native window handle upon show(), whereas 4.4.0 probably doesn't do it at that point yet. It doesn't mean that the minimal test app works with either version. You MUST let the application process its events in order to make the dialog responsive.
Qt Code:
for ( int i = 0; i < 0x7FFFFFFF; i++ ) // Simulate some work... app.processEvents();To copy to clipboard, switch view to plain text mode
J-P Nurmi
mclark (6th October 2008)
Ahhhh.... Now I see what you mean about the minimal test app.
So, what would you recommend for a solution for the real app?
I have a QDialog which needs to make a library call that may take 3-7 seconds (on average) to complete. I want to display something to let a user know that processing is happing (the app is NOT hung). I was using the GenericWaitDlg class described above.
J-P Nurmi
The call is to a library I have no control over (not a Qt call). I was hoping there might be a solution other than using a worker thread.
Does this sound reasonable:
- create my GenericWaitDlg
- create a worker thread
- connect a slot (closeGenericWaitDlg()) to the finished() signal of the thread
- in the run() method of the thread, make my library call
- when the library call is finished the thread should shutdown
- in the closeGenericWaitDlg() method call dlg.done(0) to close the wait dialog
Yes, sounds reasonable. Just remember not to touch GUI in the worker thread.![]()
J-P Nurmi
mclark (6th October 2008)
Thanks for your help, jpn. It is much appreciated!
Bookmarks