Open mself opened 4 years ago
I'm not clear why
FreqWidgetGL
is using GL at all?For performance reason I think, with GL you use hardware acceleration of GPU
If you read the page I linked to above, it seems like you can get hardware GL acceleration even if you use QPainter
for the drawing. It says
Since QGLWidget is a subclass of QWidget, it is possible to reimplement its paintEvent() and use QPainter to draw on the device, just as you would with a QWidget. The only difference is that the painting operations will be accelerated in hardware if it is supported by your system's OpenGL drivers.
In this example, we perform the same painting operations on a QWidget and a QGLWidget.
It seems like this would let you get the speed benefit of OpenGL, but without having to write OpenGL-specific code (at least for 2D views -- the 3D Harmonic would still need to be written explicitly in OpenGL).
Most of the GL views had earlier non-GL versions. So, it might not be too hard to bring those back but attach them to a QGLWidget
instead.
It seems like this would let you get the speed benefit of OpenGL, but without having to write OpenGL-specific code (at least for 2D views -- the 3D Harmonic would still need to be written explicitly in OpenGL).
It was perhaps not the case when Tartini was written with Qt3
Most of the GL views had earlier non-GL versions. So, it might not be too hard to bring those back but attach them to a
QGLWidget
instead.
But are the non-GL versions aligned with GL versions ? or have the GL version evolved after their creation ?
Unlike the on-screen view, the print view does not change which note names and lines are shown when the key, scale, or temperament are changed.
Can
FreqWidgetGL::drawReferenceLines
andFreqWidgetGL::drawReferenceLinesGL
be combined into one method?I read that Qt5 allows the use of Painter in GL views so that you don't need to write GL-specific code for 2D views in most cases. I'm not clear why
FreqWidgetGL
is using GL at all?See https://doc.qt.io/qt-5/qtopengl-2dpainting-example.html