How to add QWidget to a QGLWidget

1.2k views Asked by At

What is currently the best way to add a QWidget to a QGLWidget as a child? In this case I want to add a QSlider to QGLWidget, however it seems like half the links on Google point to dead information now so it's tricky working out what the current way to achieve this is.

I did try creating a QSlider as a child and setting the geometry, but that didn't seem to do a lot.

1

There are 1 answers

2
Kuba hasn't forgotten Monica On BEST ANSWER

Child widgets don't work with a QGLWidget, that's documented.

Use QOpenGLWidget and the child widgets will work fine. There's nothing special to do in this respect, simply add child widgets, layouts, etc., and it "just works".