Results 1 to 3 of 3

Thread: Render image on QLabel using openGl

  1. #1
    Join Date
    Jun 2011
    Location
    India
    Posts
    14
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Render image on QLabel using openGl

    Hi,
    Can somebody please tell me how to render an image on a QLabel with openGL.

    Thanks
    Vinod

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Render image on QLabel using openGl

    You cannot directly do OpenGL rendering into a QLabel. You should use QGLWidget instead.

  3. #3
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Render image on QLabel using openGl

    You can either:
    1. subclass QLabel override paint() event and use qpainter beginNativePainting() to paint using OpenGL, although graphics sub system should support OpenGL
    2. use so called off-screen render, then You don't need QGLWidget at all, only valid QGLcontext. In that case You can use anything to generate image, including shaderes etc. Then render that to qimage/qpixmap and place that pix onto QLabel.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

Similar Threads

  1. Replies: 1
    Last Post: 14th May 2011, 08:56
  2. Replies: 1
    Last Post: 14th April 2011, 00:11
  3. OpenGL render to texture
    By Nicuvëo in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2011, 13:07
  4. Replies: 1
    Last Post: 7th May 2010, 18:20
  5. Replies: 6
    Last Post: 21st September 2009, 11:55

Tags for this Thread

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.