PDA

View Full Version : Display an image to a plain QWidget



franco.amato
20th September 2010, 22:50
Hi to all,
some time ago I built a video camera viewer using Qt for a simple image processing application and I displayed every frame to a QLabel but I had some problems draw some lines on the frames so I got the suggestion to render the frames on a plain QWidget instead of a QLabel.

How can I do it?

Best Regards,
Franco

Lykurg
20th September 2010, 22:55
Who gave you that advice? I don't see any difference since QLabel inherits QWidget.

On how to do: Subclass QWidget, create proper member functions and write your own paint event.

franco.amato
20th September 2010, 23:10
Who gave you that advice? I don't see any difference since QLabel inherits QWidget.

You gave to me such advise ;-)


On how to do: Subclass QWidget, create proper member functions and write your own paint event.

So I can copy to a QWidget a uchar array?

Lykurg
20th September 2010, 23:40
You gave to me such advise ;-)
Nice. I surely had my reasons... :p


So I can copy to a QWidget a uchar array? Yeah, why not.

Kumar Dmello
19th March 2012, 10:07
sir could you please upload the sample code for displaying video frames in Qlabel.It woulb be of great help to me.