I am not so good at pyqt.Can you give me an example on how to use it?
I am not so good at pyqt.Can you give me an example on how to use it?
See this: http://zetcode.com/tutorials/pyqt4/widgets. It shows the typical way of doing things in Qt. In the Checkbox example you have a changeTitle() slot that is invoked every time the user clicks the check box. You don't need any loops to read data from the user -- the data will be delivered to you.
If you make a loop in your application, the event loop inside Qt won't run and Qt won't be able to redraw widgets and receive input from the user. So basically your application should only react to signals and events, instead of enforcing the program flow. Of course you can have loops in your code, but they should be short or the application will become unresponsive*.
The whole tutorial is here: http://zetcode.com/tutorials/pyqt4/
* You can use QCoreApplication::processEvents() to avoid this, but you should do that only as the last resort.
Thank you very much...
Bookmarks