python - PyQt: QProgressDialog shows but is empty (displays background content) -


I have a piece of code that I've used elsewhere (where is it exactly what I want), But in this case does not. Actually my function body calculates a count of things, the results bring in a penus dataframe and a platus plot into a matplot canvas.

I placed the code below at the top of my function body, hoping that this display function is a dialog box for the duration of the call. However, whatever happens, the dialog box appears, which contains the box contents that appear on the screen, which is immediately behind the screen. The function is made on the screen for the duration of the call and then it stops at the end.

What is wrong with anybody?

If this is useful, then the parent ( self) is a QWidget .

Oh, and one more thing, if I remove progress.cancel () after performing the main part of the function, then QProgressDialog actually Paint yourself with progress bar and label text ('updating ...').

Thanks a lot for your help! Progress = QProgressDialog (parent = self) progress.SetCatalButton (none) progress. Cetallable text ('Updating ...') progress. Minimum (0) progress. SetMaximum (0) progress.forceShow () #calculate and plot DataFrame progress.cancel ()

< P> I found myself at some point with the same problem and came with this decorator that I apply on the tasks that I want to block, whil GUI Thread Permission Dop Annegie (funny): "" "Function running non-gia thread while processing decorator, gui events." "" "Thunderbolt with multi-dimensional purik imports, PEact 4. Imported qApplication def (* Args, ** kwargs): pool = ThreadPool (process = 1) async = pool.apply_async (fun, args, quad) while async.ready ( ): Async.wait (0.01) QApplication.processEvents () Back Async.get () return sheet

Again, it is easy to type your calculation function normally with the decorator: / P>

  @nongui def Task (Input): # Here you calculate the output and returns the # progress dialog value to   

and then it's normal R Run in:

  outside = action (input)    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -