How Qt's Opengl widget works? Is it a software-only implementation or it relies on the configuration of the platform
It's a Qt widget that embeds an OpenGL context of the native platform - i.e. You're using the OpenGL libraries/setup on your platform - which doesn't have a lot to do with Qt
Related
As I can see in Qt6 no more Multimedia API. Am I right? Is it correct that in Qt6 for such simple task as playing sound I should look at third-party libraries now?
Qt6 is a big change so for compatibility reasons Qt does not provide this module, it will be provided in Qt 6.2 as this post: Add-on support in Qt 6.0 and beyond points out, so if you want to reproduce sounds you will have to use a third party library.
For Qt 6.2 we are planning to provide the following additional
libraries:
Qt Bluetooth
Qt Data Visualization
Qt Lottie Animation
Qt Multimedia
Qt NFC
Qt Positioning
Qt Quick Dialogs: Folder, Message Box
Qt Remote Objects
Qt Sensors
Qt SerialBus
Qt SerialPort
Qt WebChannel
Qt WebEngine
Qt WebSockets
Qt WebView
(emphasis mine)
Qt Multimedia is (again) part of Qt 6.2.
Note though that the module was undergoing a substantial rewrite. For more details, see e.g. https://www.qt.io/blog/qt-multimedia-in-qt-6 and the relevant porting documentation.
I have a Qt application that draws using Open GL. At some point I'm using a QQuickWindow associated to a QQuickRenderControl to draw a QML scene into a texture to later compose it in the final image.
Now, I'm considering porting OpenGL to Vulkan and I'm not sure if it is possible to do the same with this QML layer.
Reading Qt docs I found that
QQuickWindow uses a scene graph on top of OpenGL to render.
Do you think it is possible to port it to Vulkan? Perhaps overriding QQuickWindow and QQuickRenderControl? I'm not a Qt expert so perhaps someone can give me a better insight of the problem.
As of June 2019 and Qt 5.13, Qt Quick 2 supports the following backends:
OpenGL 2.0
OpenGL ES 2.0
Direct3D 12 (support is still experimental)
OpenVG
Software rendering
However, only OpenGL and OpenGL ES are fully functional. For instance some effects (like particles) do not work with the other banckends.
For more information about how to select a backend and what are the limitations of each backend I suggest to read the documentation: https://doc.qt.io/qt-5/qtquick-visualcanvas-adaptations.html
Regarding Vulkan specifically, Qt has added support to it since Qt 5.10.
However, the support is still very limited and does not cover Qt Quick.
Change will come in the future; quoting an email from Qt development mailing list:
A very early preview of Qt Quick for Vulkan, Metal, and D3D11 may come already in Qt 5.14, then evolve in 5.15 and beyond, with 6.0 as its final destination.
So rendering Qt Quick with Vulkan should be possible when Qt 6 will be out. The planned release date for Qt 6 is currently November 2020. In the mean time technical previews might be available starting with Qt 5.14.
I would not be too optimistic for anything before Qt 6 as (1) it will just be technical previews and (2) as far as I know, current official Qt binaries are not linked with Vulkan at all and you need to build Qt from source if you want to use Vulkan.
When downloading from this site http://qt-project.org/downloads
There are different versions like versions with OpenGL and versions without OpenGL, what is the different between them ?
Some time ago Google did develop a OpenGL emulation wrapper called ANGLE, to implement conformant WebGL on systems without a proper OpenGL installation, yet with sufficient Direct3D support. Qt makes internally use of OpenGL in some modules/classes. The non OpenGL downloads of Qt are linked with ANGLE to reliably enable this, even without proper OpenGL drivers on the system. The OpenGL versions of the download use the systems native OpenGL.
Is OpenGL mandatory in order to run a Qt application made of QML pages ?
Well, an implementation of OpenGL ES 2 is mandatory for Qt Quick 2, but that doesn't mean you need to use native OpenGL. On Windows you really should be using ANGLE, since on many Windows systems the installed OpenGL is either too old or broken.
Yes, with Qt Quick 2.0 OpenGL is a mandatory requirement.
It appears that glMultiDrawArrays is not available by default in QT's Opengl library. Is there anyway I can make it available in QT ?
Qt is only responsible for creating an OpenGL context, not for providing OpenGL calls.
Try using a loader library like gl3w or GLEW in order to access modern OpenGL features.
There is no such thing as Qt's OpenGL library, OpenGL is handled by your OS, Qt only provides a wrapper for platform-independent OpenGL Context and Window creation.
Whatever that function is available or not depends on your OpenGL drivers, OpenGL headers, etc.