Results 1 to 4 of 4

Thread: How to paint across/over multiple widgets?

  1. #1
    Join Date
    Oct 2005
    Posts
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default How to paint across/over multiple widgets?

    I have a main display widget that has one standard grid layout managing multiple child widgets.

    How do I paint (overlay) across all the child widgets?

    (Currently, as a work aroud I'm just using a dummy borderless widget with masked pixmap background on top... but I like to be able to blindly paint over all the widgets)

    -r.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to paint across/over multiple widgets?

    I don't think there is an easy way of doing that in Qt3. The easiest way is probably to install an event filter on all child widgets of a parent widget and draw there.

  3. #3
    Join Date
    Oct 2005
    Posts
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to paint across/over multiple widgets?

    Yes -- capturing (overriding) the child widgets paintEvent and drawing over existing pixmap is straight forward enough.

    But I would like to draw a single banner covering all or some of the child widgets.

    For example, lets say it's a client/server app, and the server has discounnected..
    I would like to paint a big text/sign warning that says "TIMEOUT: DISCONNECTED" across the main display.. and in this case the main display is a layout with many child widgets...

    -r.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to paint across/over multiple widgets?

    You can use the same mechanism. In event filter you should force the paint event of child widget and then paint over the result. I guess it would be much easier with Qt4.

Similar Threads

  1. Replies: 11
    Last Post: 7th July 2006, 13:09
  2. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23
  3. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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.