PyQt and Threading to update a dialog?

Discussion in 'Python' started by Fabian Steiner, Feb 20, 2006.

  1. 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
     
    Fabian Steiner, Feb 20, 2006
    #1
    1. Advertising

  2. 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
     
    Phil Thompson, Feb 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulysses
    Replies:
    4
    Views:
    824
    Werner Schiendl
    Oct 22, 2003
  2. Marcpp

    Pyqt calling custom dialog

    Marcpp, Apr 12, 2007, in forum: Python
    Replies:
    0
    Views:
    430
    Marcpp
    Apr 12, 2007
  3. Marcpp
    Replies:
    3
    Views:
    1,483
    Marcpp
    Apr 17, 2007
  4. Steven Woody
    Replies:
    0
    Views:
    478
    Steven Woody
    Jan 9, 2009
  5. Steven Woody
    Replies:
    0
    Views:
    492
    Steven Woody
    Jan 9, 2009
Loading...

Share This Page