Results 1 to 6 of 6

Thread: QGLWidget: Draw 100% of image (even when hidden)

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QGLWidget: Draw 100% of image (even when hidden)

    Hey!

    I am using a QGLWidget displayed in a QMdiSubWindow. Now it can happen hat other subwindows are on top of the QGLWidget or the widget is hidden / minimized.

    Is it possible to make the QGLWidget drawing 100% of the widget-content? The images are send over a TCPsocket to an embedded system. So I have to make sure that the picture that was send to the remote system is not broken (subwindows overlaying parts of the widget) or old (QGLWidget hidden -> no new images)

    I thought that this is a common question, but I couldn't find any similar topic in the forum so far.

    J.R.

  2. #2
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGLWidget: Draw 100% of image (even when hidden)

    In the end I "solved" it by not using a Qt class.
    Does anybody know whether offscreen rendering is possible with Qt?
    Just a Qt-Class generating images and storing them in a buffer / pixmap etc.

    There are many results when you ask google about that topic, but so far there was no build in solution. Just some dirty workarounds etc.

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QGLWidget: Draw 100% of image (even when hidden)

    You can paint directly onto a QImage object. You can then use QPainter's drawImage() function to "blit" the image onscreen.

  4. #4
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget: Draw 100% of image (even when hidden)

    Have you tried QGLWidget's renderPixmap(int,int,bool)

  5. #5
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget: Draw 100% of image (even when hidden)

    Does anybody know whether offscreen rendering is possible with Qt?
    Yes it is very possible and real. I've had success render off screen by rendering into a QGLFramebufferObject. Not only that. I prefer this method to render content (images) because QGLWidget::renderPixmap often requires a new QGLContext and sharing the context has not be reliable for me. Plus, you can use existing display lists and vbos.

    Bottom Line render in to a QGLFramebufferObject or a QGLPixelBuffer if you want render off screen. No need to create new display lists or worry with context stuff.

    Hope this Helps

  6. #6
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget: Draw 100% of image (even when hidden)

    Hello,

    I am new to QOpenGLWidget and using OpenGL ES 2.0. I have been trying to display the camera captured frame in QOpenGLWidget but it shouldn't works just getting blank screen, The captured image is good but opengl window is not updating the frame just blank screen I have used QGLWidget for frame display with QT 5.2.1. Now I am trying to port it to Raspberry pi and it has ES 2.0 API and QT 5.4.1 QOpenGLWidget.

    Thanks

    Tushar Kachhadiya

Similar Threads

  1. Save Image of QGLWidget to file
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 3rd March 2010, 16:36
  2. Replies: 3
    Last Post: 22nd October 2009, 07:46
  3. Replies: 6
    Last Post: 21st September 2009, 10:55
  4. add(draw) an icon(or image) to a QPixmap?
    By ascii in forum Qt Programming
    Replies: 4
    Last Post: 20th November 2008, 12:44
  5. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06

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.