You are not logged in.


Wednesday, February 8th 2012, 11:40pm

Displaying an image in QGLWidget

I have a QGLWidget (two of them, actually) in a QGridLayout in a QMainWindow. I'm trying to display the contents of an image file over a background. I can get the background onto it until paintEvent runs; then, instead of drawing the image on top of the background, it simply erases the backround.

(Change .cpp to .h to get header files.)
the QGLWidget:
the QMainWindow:
all files:

The project is attached in a zip file with irrelevant portions removed.

I can't find examples for this anywhere, and as far as I can tell I'm following the documentation perfectly. I've been hung up on this problem for two days now, I believe. Help, please!
Jesdisciple has attached the following file:
  • (44.29 kB - 9 times downloaded - latest: Sep 29th 2016, 2:16pm)

This post has been edited 6 times, last edit by "Jesdisciple" (Feb 10th 2012, 6:59pm)


Friday, February 10th 2012, 6:19pm



Tuesday, May 8th 2012, 2:14am

May be I am late in this post,
however may be this link will help you.…magini/?lang=en




  • "jiapei100" is male

Posts: 36

Location: Surrey, BC, Canada

Occupation: Programmer

  • Send private message


Tuesday, February 26th 2013, 12:45pm

I've got exactly the same question to ask...
Welcome to Vision Open

Similar threads