![]() KDE Developer ![]()
|
Hello guys.
I've been having a bit of a hard time getting Timers to work properly with my PyQt4 apps. I thought maybe you guys could tell me what I am doing wrong. The problem is that the updateTimer function gets called twice per second the second time you start the timer. The third time you start the timer updateTimer gets called 3 times on each timeout, and so on. I have no clue why this is happening. Here's an example of what I'm trying to do:
And here's timerexample.ui. Note that you will have to resize the window once you start the app because I was too lazy to fix the mainwindow's minimum size. =P
Any help is appreciated!
Last edited by JontheEchinda on Sun Dec 21, 2008 3:58 am, edited 1 time in total.
|
![]() KDE Developer ![]()
|
You connect to the signal every time you start the timer, ending up with one additional connection for every start.
Just connect once, e.g. in the constructor after creating the timer Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() KDE Developer ![]()
|
Aaaah! It's so obvious now. Thanks a lot.
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell