Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Execution order

Reply
Thread Tools

Execution order

 
 
DarkBlue
Guest
Posts: n/a
 
      09-11-2009
Here is some code from a pyqt4.5.4 application on python 2.6

def findData(self):

self.ui.label.setText('Processing... ')

# here we do something which takes a few seconds
self.refreshGrid()



The problem is that the text in the self.ui.label is only changed
on screen after the self.refreshGrid() has finished executing
rather than before.

How do I achieve the expected result ?

Thanks
Db



 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      09-11-2009
DarkBlue wrote:

> Here is some code from a pyqt4.5.4 application on python 2.6
>
> def findData(self):
>
> self.ui.label.setText('Processing... ')
>
> # here we do something which takes a few seconds
> self.refreshGrid()
>
>
>
> The problem is that the text in the self.ui.label is only changed
> on screen after the self.refreshGrid() has finished executing
> rather than before.
>
> How do I achieve the expected result ?


You can make Qt process all pending events once, via
QCoreApplication.processEvents.

This should trigger the redraw.

Diez
 
Reply With Quote
 
 
 
 
DarkBlue
Guest
Posts: n/a
 
      09-11-2009
On Sep 11, 9:34*pm, "Diez B. Roggisch" <(E-Mail Removed)> wrote:
> DarkBlue wrote:
> > Here is some code from a pyqt4.5.4 *application on python 2.6

>
> > def findData(self):

>
> > * * * self.ui.label.setText('Processing... ')

>
> > * * * # here we do something which takes a few seconds
> > * * * self.refreshGrid()

>
> > The problem is that the text in the self.ui.label *is only changed
> > on screen after the self.refreshGrid() has finished executing
> > rather than before.

>
> > How do I achieve the expected result ?

>
> You can make Qt process all pending events once, via
> QCoreApplication.processEvents.
>
> This should trigger the redraw.
>
> Diez


Thanks ! That helped.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack sndive@gmail.com Python 9 11-14-2007 10:31 PM
doubt in FLI Program and order of execution priya VHDL 0 10-03-2005 12:55 PM
Re: A question about order of execution? John Saunders ASP .Net 2 07-15-2004 06:44 PM
Execution order of Validation Controls Bijoy Naick ASP .Net 1 06-08-2004 04:31 PM
Execution order of PageLoad for user controls =?Utf-8?B?QmlsbCBCb3Jn?= ASP .Net 2 03-06-2004 03:01 PM



Advertisments