qt-interest@trolltech.com
[Top] [All Lists]

Re: background image and foreground widgets

Subject: Re: background image and foreground widgets
From: André Somers
Date: Thu, 11 May 2006 11:39:50 +0200
Bob Lapique wrote:

> I would like to display an instrument diagram (i.e. pipes, solenoid
> valves, sensors, etc) as a background image in a widget.
> 
> Superimposed on that image, I would like to display component status
> (open/closed valves, sensor measurements). And I would like those
> indicators to be placed next to their representation in the background
> image.
> 
> 
> I can display an image in a QLabel, for example. But how can I add other
> objects in the foreground ?

An easy way to do this is to subclass QLabel, and reimplement it's
paintEvent method. Here, you first call QLabel::paintEvent, and then you
simply draw your own stuff on top.

André

-- 
thermiek is een keuze!

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>