Re: [PyQt] how to use the button to control the program

2013-08-08 Thread David Hoese
Geometry(300, 200, 600, 400) > self.setWindowTitle('Battery status') > self.show() > > def newtime(self): > while True: > nowtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) > self.timeEdit.setText(s

Re: [PyQt] how to use the button to control the program

2013-07-31 Thread David Hoese
function does not have returns, can the button connect the function? The newtime function realizes a loop to change the time every 1s, there is no return. I want to click the 'start' button to begin the function, how to realize that? Thanks in advance -Harry 2013/7/31 David Hoese mailto:dho..

Re: [PyQt] Multithreading and plotting

2013-01-16 Thread David Hoese
I know what you mean about "not only if it's working", I work for a meteorology department at a University, it happens. Your solution will work, but did you try my solution? Or did mine not make sense? It might just be me, but most programmers look down on global variables. Your solution isn

Re: [PyQt] Multithreading and plotting

2013-01-15 Thread David Hoese
On 1/15/13 9:46 AM, Fabien Lafont wrote: I've changed the program according to your remarks. It works fine! I have only one problem. I want to start the new thread when I clik on a QPushButton but If I just remove thread = AThread() thread.start() from if __name__ == "__main__":

Re: [PyQt] Multithreading and plotting

2012-12-21 Thread David Hoese
Hey Fabien, See comments below and the bottom for my final changes. Please CC me in replies. On 12/21/12 5:06 AM, lafont.fab...@gmail.com wrote: Hello everyone, I'm trying to plot live datas using matplotlib and PyQt. I need a multithreaded program beacause I use time.sleep and it freeze com