Results 1 to 5 of 5

Thread: Display an image to a plain QWidget

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Display an image to a plain QWidget

    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
    Franco Amato

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Display an image to a plain QWidget

    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.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display an image to a plain QWidget

    Quote Originally Posted by Lykurg View Post
    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?
    Franco Amato

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Display an image to a plain QWidget

    Quote Originally Posted by franco.amato View Post
    You gave to me such advise ;-)
    Nice. I surely had my reasons...

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

  5. #5
    Join Date
    Feb 2012
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display an image to a plain QWidget

    sir could you please upload the sample code for displaying video frames in Qlabel.It woulb be of great help to me.

Similar Threads

  1. Display a QWidget on a remote computer
    By tarod in forum Qt Programming
    Replies: 4
    Last Post: 24th July 2008, 07:41
  2. Display a QWidget on two X-Server at the same time
    By tarod in forum Qt Programming
    Replies: 0
    Last Post: 1st July 2008, 12:55
  3. Display a QWidget using multi-screen
    By tarod in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2008, 14:02
  4. Replies: 3
    Last Post: 8th March 2007, 14:54
  5. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07

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.