Results 1 to 2 of 2

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

  1. #1
    Join Date
    Aug 2011
    Qt products
    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)

    Wrong behaviour observed in my actual application:

    -> Custom Event
    -> QEvent::UpdateRequest (77)
    -> Custom Event
    -> QEvent::UpdateRequest (77)
    -> 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!

    Last edited by alexlordax; 25th August 2011 at 18:37.

  2. #2
    Join Date
    Jan 2006
    Munich, Germany
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    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!):

    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, 11:58
  2. Strange responsiveness/repaint behavior.
    By JoeBauman in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2011, 18: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, 15:39
  4. repaint issue in qt4
    By ancest in forum Qt Programming
    Replies: 2
    Last Post: 12th March 2009, 10:51
  5. QSqlDatabase Time out no network to long....
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2007, 01:41

Tags for this Thread


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.