[Qt-interest] Widget stack order rearrangement.

Gabriel M. Beddingfield gabrbedd at gmail.com
Thu Apr 14 14:37:39 CEST 2011


I'm having trouble with a QGLWidget and a QLabel.  The 
QGLWidget is on top of the QLabel, but the QGLWidget appears 
as a black rectangle that is the size of the widget.  I do 
not see the QGLWidget's graphics.  Any idea what could be 
causing this?

An image of the problem is here: http://gabe.is-a-
geek.org/tmp/bugs/qglwidget-overlap-issue.jpg

I create it more or less like this:

   QWidget *anon = new QWidget;
   QLabel *background = new QLabel(anon);
   background->setPixmap(some_background_pixmap);
   background->lower();
   QGLWidget wid = new WGLWaveformViewerFactory();
   wid->setParent(anon);

This gives the un-expected results.  However, if I create a 
small test case it works as expected (correctly).

If I move the `background->lower()` to the end, it works as 
expected.  (The problem is that I'm loading these widgets in 
document order... and at the end of the process I can't re-
access the QLabel's pointer.)

If I put background->raise() at the end, the QGLWidget 
becomes totally obscured, and there is no black rectangle.

I'm using Qt 4.7.2 on MeeGo 1.1.99.x (x86/Atom/Pinetrail).  
MeeGo is using GLESv2.  The application is Mixxx 1.9.0 (not 
actually my app).

Thanks,
Gabriel



More information about the Qt-interest-old mailing list