Results 1 to 2 of 2

Thread: Strange issue with widget failing to repaint for a long time.

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Strange issue with widget failing to repaint for a long time.

    I am having a strange issue with a widget failing to repaint for a long time.

    I have one non-Qt thread that plays audio and periodically posts a custom event to my GUI thread, based on audio playback position. The GUI thread reacts by generating some visual feedback (e.g., display label on top of a widget) and invoking repaint() on itself. This works great on Mac OSX and it works fine within a unit test application I have that exercises the functionality on Windows (XP & 7), however, the widget does not properly repaint in my real application, on Windows XP/7, until the audio playback finishes.

    Proper behaviour observed on OSX and within my unit test:

    -> Custom Event
    -> QEvent::Paint (12)
    -> Custom Event
    -> QEvent::Paint (12)
    etc.

    Wrong behaviour observed in my actual application:

    -> Custom Event
    -> QEvent::UpdateRequest (77)
    -> Custom Event
    -> QEvent::UpdateRequest (77)
    etc.
    -> QEvent::Paint (12)

    I have tried various things to force the repaint to occur, e.g., QCoreApplication::processEvents, but all to no avail. I have also tried eliminating the inter-thread events as a culprit and used a periodic timer to poll the current position from the audio thread and update the widget, also without much luck.

    Any ideas on how to further diagnose this would be greatly appreciated!

    Thanks,
    Alex
    Last edited by alexlordax; 25th August 2011 at 17:37.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Strange issue with widget failing to repaint for a long time.

    quick and dirty try (since I know nothing about your code) would be to try repaint() instead of update().
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. design pattern for long time operation
    By Talei in forum Qt Programming
    Replies: 6
    Last Post: 22nd July 2011, 10:58
  2. Strange responsiveness/repaint behavior.
    By JoeBauman in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2011, 17:14
  3. qt 3.3.8 mainform.ui Compiling time too long
    By lupin982 in forum Qt Programming
    Replies: 0
    Last Post: 8th March 2010, 14:39
  4. repaint issue in qt4
    By ancest in forum Qt Programming
    Replies: 2
    Last Post: 12th March 2009, 09:51
  5. QSqlDatabase Time out no network to long....
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2007, 00:41

Tags for this Thread

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.