Results 1 to 3 of 3

Thread: Window performance problem

  1. #1
    Join Date
    Jun 2009
    Location
    Gdansk, Poland
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Window performance problem

    Hello,

    I have a QThread that sends signals to QGLWidget slot function which invokes repaint() at the end. The animation in QGLWidget is OK, but when I try to do something with the window (e.g. Move it using its title bar) it responds very slow to eny reactions. It looks as if the repaint operation is invoked so frequently that the window event loop cannot process its events in appropriate time.

    Do you know what`s the cause of the problem? Thanks

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Window performance problem

    I have not worked with QGLWidget specifically, but for QWidget in general you should use update() rather than calling repaint() directly since calling update() several times normally results in just one paintEvent() call.

    We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.
    Not sure if that helps.

  3. #3
    Join Date
    Jun 2009
    Location
    Gdansk, Poland
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Window performance problem

    I have already tried this but this did not help. Any other ideas?


    Added after 1 22 minutes:


    I discovered that both QEvent::Paint and QEvent::Move and QEvent::Resize are handled by the same thread and loop. That seems to be a root cause of a problem, QEvent::Paint occurs so frequent that multiple QEvent::Move cannot be processed smoothly one after one. Can I assign some priorities to those eventsa so that QEvent::Move and QEvent::Resize would have the highest priority? Maybe there is another solution?

    I can always try to invoke sleep on thread which causes repait when QEvent::Move is raised but this seems to be a bad solution...
    Last edited by aleksjej; 26th December 2010 at 20:16.

Similar Threads

  1. Performance problem with processEvents() on Mac OSX
    By ahmedb in forum Qt Programming
    Replies: 0
    Last Post: 10th May 2010, 14:01
  2. Q3Table performance problem
    By batileon in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2008, 15:32
  3. graphicsview performance problem
    By kernel_panic in forum Qt Programming
    Replies: 16
    Last Post: 23rd December 2007, 18:19
  4. QTableView Performance Problem on Windows
    By umitoz in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 16:47
  5. Performance problem with GrapicsPathItem
    By amnesiks in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2007, 05:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.