Results 1 to 7 of 7

Thread: While loop problem in pyqt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    1

    Default Re: While loop problem in pyqt

    I am not so good at pyqt.Can you give me an example on how to use it?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: While loop problem in pyqt

    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.

  3. #3
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    1

    Default Re: While loop problem in pyqt

    Thank you very much...

Similar Threads

  1. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 22:55
  2. Replies: 16
    Last Post: 7th March 2006, 16:57
  3. While statement inside the main loop
    By OnionRingOfDoom in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2006, 19:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.