kanryu / quickviewer

A image/comic viewer application for Windows, Mac and Linux, it can show images very fast
https://kanryu.github.io/quickviewer/
GNU General Public License v3.0
536 stars 63 forks source link

QGLWidget is depricated #89

Open kah0922 opened 5 years ago

kah0922 commented 5 years ago

QuickViewer uses QGLWidget for OpenGL; however, since Qt5.4, it is recommended to switch to QOpenGLWidget instead as QGLWidget is included for legacy compatibility reasons.

I can't even get QuickViewer to compile with OpenGL support on OpenSUSE Tumbleweed.

kanryu commented 5 years ago

As is well known, QGLWidget is older than QOpenGLWidget. However, when using QOpenGLWidget on Windows, the specification was canceled because of a fatal performance problem. Likewise, since QWidget (that is, OS standard rendering) is faster than QGLWidget, now it is no longer possible to use OpenGL itself.

The above results are for Windows PCs only, Linux may be different results. First of all, please comment out QV_WITHOUT_OPENGL as expected by the source code and run it on your Linux. Is there a difference in behavior? Especially, compare the time taken to display the image files from the digital camera and switch the images with the cursor keys.

Enjoy! :)

kah0922 commented 5 years ago

I can't actually do that because it fails to compile when I enable it.

kanryu commented 5 years ago

I tried it, but since QuickViewer uses a hidden function QGLWidget calls Shader, the version of Qt needs to be somewhat new (5.7 OK). However, if you combine OpenGL and AppImage, Shader files may not be found and may not be working properly.

kah0922 commented 5 years ago

Alright, so it looks for the "shaders" folder in the same directory as the binary. For packaging, that's huge problem, as no asset should be in /usr/bin. It should be in /usr/share/QuickViewer/shaders

As for my tests, Bicubic is completly broken, as it complains about an unsupported GLSL version (it only supports up to 3.00 and I have 3.30 apparently) and Lanczos only works if you reselect it. Opening a file with the option selected does not work.

This is with QT5.11

kanryu commented 5 years ago

If you are planning to look into this option from programming or interest in OpenGL you will welcome. However, if you intend to introduce QuickViewer into your Linux Distribution, this option does not have to be discussed now.

This is because the standard drawing method of the OS is faster than using OpenGL at least on Windows for displaying images.

I noticed that fact in pretty earlier versions, and no longer use OpenGL, this option is deprecated.