View Full Version : How to paint across/over multiple widgets?

30th August 2006, 22:16
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)


30th August 2006, 22:36
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.

30th August 2006, 23:18
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...


31st August 2006, 10:57
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.