fstl-app / fstl

A fast STL file viewer
463 stars 106 forks source link

Update to QOpenGL* Classes #29

Closed DeveloperPaul123 closed 6 years ago

DeveloperPaul123 commented 6 years ago

Would be nice to update all uses of QGL* classes to use instead QOpenGL* classes.

DeveloperPaul123 commented 6 years ago

@mkeeter I've started implementing this change and got the following results:

2018-03-08_22-16-25

Any initial thoughts on what could be going on? All I've done is migrate all QGL classes to their QOpenGL variant.

One thing I'll note is that changing QGLFormat to QSurfaceFormat resulted in me having to remove the call to setSampleBuffers(true) since that method doesn't exist for QSurfaceFormat. I have yet to find an equivalent class method or a way to set that same setting to true somewhere else.

mkeeter commented 6 years ago

That's really weird.

My theory: if you've changed from a QGLWidget to a QOpenGLWidget, the custom drawing needs to go in void paintGL() override, rather than paintEvent, and needs to be wrapped in calls to painter.[begin/end]NativePainting() (e.g. how I do it here).