Results 1 to 3 of 3

Thread: No paintEvent is called

  1. #1
    Join Date
    Jul 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default No paintEvent is called

    Hi to all,

    we have a serious problem to display a video on a widget.
    We have a
    MainWindow(public QMainWindow)
    |
    |--> VideoWidget(public QWidget)
    |
    |--> MainMenuBar(public QWidget) with transparent Buttons and Labels
    |--> Statusbar (public QWidget) with transparent Buttons

    After displaying some Video, this could be some Minutes or many hours, the paintEvent()-Function isn't called correctly. When it is called, it didn't update the widget correctly. Only parts of it will be updated. So it isn't possible that the paintEvent isn't called, why the widget is not visible. The rect from the widget is also correct, and the the flag setUpdateEnabled is set to true.
    So, what else can happen, that the paintEvent isn't called.

    HeReSY

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No paintEvent is called

    Try setting Qt::WA_OpaquePaintEvent to true.

    It would be very useful if you could share some code that reproduces this issue. (fully working example -- it will get you the highest chance of proper help)
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

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

    Default Re: No paintEvent is called

    This smells very much as a thread related problem.
    If this application is threaded, and you are updating your frame from a thread, something there is not done right.
    You either run in to a deadlock, or race condition or similar.
    ==========================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. paintEvent not getting called with QMainWindow
    By DiamonDogX in forum Qt Programming
    Replies: 12
    Last Post: 15th June 2011, 22:23
  2. paintEvent help
    By seltra in forum Newbie
    Replies: 11
    Last Post: 18th September 2010, 19:24
  3. Replies: 0
    Last Post: 29th April 2010, 05:44
  4. Why Qt is called Qt?
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2009, 07:40
  5. Replies: 12
    Last Post: 5th February 2006, 10:34

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.