Results 1 to 2 of 2

Thread: Widget paint artefacts on MdiSubwindow

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Widget paint artefacts on MdiSubwindow

    Hello,

    I have an QMainWindow application whose central widget is a MdiArea displaying MdiSubWindows. Each subwindow contains a widget which repaints itself every second. The widget draws a pixmap by setting the WA_PaintOutsidePaintEvent to true (simple example code attached). The code presented is a simplification of a much larger application in which many such pixmaps appear and it would be expensive to use update (ie paint event) to update only a few pixmaps.

    ok.png

    if I overlay two of the subwindows the pixmap for the bottom subwindow shows up in the top sub window

    nok.png


    I'm trying to determine if this is a bug or if my coding is incorrect. Both 4.7.4 and 4.8.1 show the same behaviour.

    Any ideas or suggestion would be very appreciated.
    Attached Files Attached Files
    Last edited by oberlus; 4th May 2012 at 01:06.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Widget paint artefacts on MdiSubwindow

    It works for me using Qt 4.6.x on Ubuntu 10.04.
    It may be bug introduced in 4.7.x+ but I can't test it at the moment.

    Also, I disagree that it would be expensive to paint only some of those pixmaps using paint event.
    Clipping should remove all the overhead you may encounter.

    You could also trigger update() slot only on those you want to update, instead on all of them.
    Just put the drawing in the paint event, and connect your timer to update() and you will get the same result via proper channels (actually, in your example you don't have to connect anything, but I assume that in your project pixmap changes while it's visible and should be repainted).

Similar Threads

  1. Replies: 1
    Last Post: 24th March 2011, 14:38
  2. Embedded Linux QT 4.5.3 [Repaint artefacts under transparent widget]
    By AsAndrew in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th October 2010, 08:04
  3. Replies: 14
    Last Post: 11th January 2010, 16:26
  4. How to paint a widget outside paintEvent()
    By wesley in forum Qt Programming
    Replies: 10
    Last Post: 27th February 2008, 03:19
  5. paint central widget of a QMainWindow???
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 17th January 2007, 08:02

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.