Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
PyQt processEvents not processing
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
DarkBlue  
View profile  
 More options Nov 7, 3:12 pm
Newsgroups: comp.lang.python
From: DarkBlue <pict...@gmail.com>
Date: Fri, 6 Nov 2009 20:12:02 -0800 (PST)
Local: Sat, Nov 7 2009 3:12 pm
Subject: PyQt processEvents not processing
qt 4.5.3
pyqt 4.6.1
python 2.6

I have this QtTable widget which I want to refresh once about every 2
seconds with new data.

so I do :

 def updateSchedule(self):
         for j in range(0,10):
                      doUpdate()
                      QtCore.processEvents()
                      sleep(2)

 unfortunately QT appears to wait until the for loop finishes
 and only then paints the QtTable widget on the screen showing
 only the latest updated result.

if I connect the doUpdate() to a Qtpushbutton widget and physically
click the pushbutton , everything is fine and the updates get shown on
every click.

What is the right way to simulate this pushbutton click  so that
the table widget gets 'visibly' refreshed for every iteration of the
loop ?

Thanks
Db


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Boddie  
View profile  
 More options Nov 8, 3:04 am
Newsgroups: comp.lang.python
From: David Boddie <da...@boddie.org.uk>
Date: Sat, 07 Nov 2009 17:04:13 +0100
Local: Sun, Nov 8 2009 3:04 am
Subject: Re: PyQt processEvents not processing
On Saturday 07 November 2009 05:12, DarkBlue wrote:

It's difficult to know exactly why this is without more context. Calling
the application's processEvents() method should give the user interface the
chance to update itself, but perhaps you need to explicitly call update()
on the QTableView or QTableWidget instance to ensure that it is refreshed.

An alternative way to do this is to use a timer to update the table every
two seconds.

David


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
DarkBlue  
View profile  
 More options Nov 8, 1:16 pm
Newsgroups: comp.lang.python
From: DarkBlue <pict...@gmail.com>
Date: Sat, 7 Nov 2009 18:16:50 -0800 (PST)
Local: Sun, Nov 8 2009 1:16 pm
Subject: Re: PyQt processEvents not processing
On Nov 8, 12:04 am, David Boddie <da...@boddie.org.uk> wrote:

As per your suggestion I added a timer to the init part and now the
update works as expected , even without calls to processEvents.

self.myTimer = QtCore.QTimer(self)
QtCore.QObject.connect(self.myTimer,QtCore.SIGNAL("timeout()"),
self.doUpdate)
self.timerTime = 0
self.myTimer.start(2000)

Thanks
Db


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google