Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PyQt and Threading to update a dialog?

Reply
Thread Tools

PyQt and Threading to update a dialog?

 
 
Fabian Steiner
Guest
Posts: n/a
 
      02-20-2006
Hello!

I have just written a MyDialog class which is derived from the orginial
QDialog class. MyDialog only possesses a QLabel and a QPushButton. Now I
would like to get the QLabel updated every second so that it displays
the current time.
I think I will have to work with Threads in order to achieve this aim,
but so far I didn't succeed in doing it because I couldn't find any
examples.

Could anyone give me some hints or a piece of code?

Cheers,
Fabian Steiner
 
Reply With Quote
 
 
 
 
Phil Thompson
Guest
Posts: n/a
 
      02-20-2006
On Monday 20 February 2006 10:07 pm, Fabian Steiner wrote:
> Hello!
>
> I have just written a MyDialog class which is derived from the orginial
> QDialog class. MyDialog only possesses a QLabel and a QPushButton. Now I
> would like to get the QLabel updated every second so that it displays
> the current time.
> I think I will have to work with Threads in order to achieve this aim,
> but so far I didn't succeed in doing it because I couldn't find any
> examples.
>
> Could anyone give me some hints or a piece of code?


So long as you have the event loop running it's probably easiest to use a
QTimer that connects to a slot in your QDialog sub-class.

No need to use threads.

Phil
 
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
Re: threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:48 AM
threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:15 AM
Cooperative threading preemptive threading - a bit confused failure_to@yahoo.co.uk Java 9 12-29-2007 01:10 AM
Update on PyQt-Mac forthcoming Kevin Walzer Python 0 11-10-2004 09:09 PM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM



Advertisments