qt - How can QWindow replace QGLWidget? -
qt docs since qt5 should use qopengl* classes instead of qgl*.
problem there no qglwidget replacement. figured out instead should use qwindow in conjunction qopenglcontext , call setsurfacetype( openglsurface );.
only problem qwindow can't have qwidget parent. how can embed qwindow aka. opengl drawing surface other widgets?
qt 5.1 in weird situation opengl , qwidget (and derived) wise. there's no qglwidget replacement yet other qgl classes have clear replacements.
if don't want use old qglwidget indeed have manufacture replacement qwindow. so, first set qwindow then, correctly said call setsurfacetype( openglsurface ); before call create(); on it. create new qopenglcontext , use makecurrent() function , pass qwindow. create qwidget qwindow using qwidget::createwindowcontainer(window);
but temporary hack, shouldn't have use unless want mix qtquick qwidget. can replace temporary hack actual replacement in 5.2.0 5.4.0 called qopenglwidget
Comments
Post a Comment