QT installation - OpenGL (No ANGLE) - qt

I have installed the last version of QT but it seems that this one contains some DirectX calls, so I expect that the default installer use ANGLE !
I wish to install a 100% openGL version, but I can't find one !
Any idea ?
Thx

All official binary packages are configured with
-opengl dynamic
which means that programs can either use the installed (desktop) OpenGL driver, DirectX (via ANGLE), or an OpenGL emulation in software (Mesa) as OpenGL backends. If you always want to use Desktop OpenGL, you can force this by
Setting the environment variable QT_OPENGL to desktop
Calling QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL)
See also http://doc.qt.io/qt-5/windows-requirements.html#graphics-drivers .
If you want a Qt version that only supports the Desktop OpenGL backend, you have to build Qt from sources.

Related

Self-contained toolchain for Qt for x86 Linux/Windows

I am setting up a Qt project which will be cross-copiled for a given display (running on ARM/Linux). The display will come with a self-contained cross-build toolchain which comprises Qt libraries with a specific Qt version (probably 5.15).
Now I would like to use a specific "static" toolchain incl. Qt libraries to also generate x86-builds of this Qt project (for testing, simulation; building/running on Linux and maybe also on Windows).
I'd avoid using the GCC and Qt development files introduced by the Linux package manager (e.g. apt), because the are not tied to a specific Qt version, i.e. upgrading the OS would always come with the risk to introduce build problems or break compatibility completely.
Are there good-practice approaches to achieve this?
So far I see three options:
Use a docker image
Possible problems:
Finding a image with the correct Qt version
building the Qt application would then work, but to execute it, the compatible Qt LGPL shared libs need to be available to the Qt application binary
Use a x86 -> x86 "standalone" toolchain
Find some standalone x86-toolchain analog to those (x86 -> x86), but additionaly...
it would either have to come with the Qt development files in the correct version
or we would have to build the Qt sources with this toolchain, and then extend the toolchain with the Qt built artifacts
Would be the preferred solution (and currently seems to be the most feasible of the approaches I can think of).
Virtual machine
Possible problems:
Finding a OS version with the correct Qt version
Select a OS version that contains the correct Qt version via package manager.
Not very elegant.
Qt online installer
only provides a limited choice of Qt versions (as of today: 5.15.2, 6.2.4, 6.3.2, 6.4.0) which is probably subject to change in the future

Qt + VTK +Ubuntu on VirtualBox

I need to run a Qt project with VTK on Ubuntu and I'm using VirtualBox, but I have an error:
GL version 2.1 with the gpu_shader4 extension is not supported by your
graphics driver but is required for the new OpenGL rendering backend.
Please update your OpenGL driver. If you are using Mesa please make
sure you have version 10.6.5 or later and make sure your driver in
Mesa supports OpenGL 3.2.
Recent version of VTK use a new rendering backend by default. In the CMake cache file used to configure your build, the corresponding cmake variable VTK_RENDERING_BACKEND has the value "OpenGL2" which assumes a minimum OpenGL API version of 2.1. But the problem is that a vanilla installation of VirtualBox does not grant access to 3D acceleration by default as it cannot presumably infer these informations from the host system.
So I think that you have several options here depending on your needs and constraints, you could install the VirtualBox Guest Additions to enable hardware 3D acceleration, allow access to a newer version of the OpenGL API and use in the end the host to performs the requested 3D operations. You could also use a recent version of the Mesa3D library to performs the needed 3D operations on the CPU (to choose preferably if you don't have graphics hardware on the host). For a presentation of its features, you can take a look here

Application fails with "Compiling Vertex shader failed"

I'm using Qt 5.2.1 and have compiled it for OpenGL (using build-option "-opengl desktop"). Now when I try to use a component that should make use of OpenGL, it fails with a
qFatal("Compiling Vertex shader failed")
All other Qt-applications that do not use OGL still work fine. The test-application mentioned above is just a ready-to use demo, no self-written crap.
Any idea what the reason could be or what I could check to find out what's wrong?
Thanks!
Windows only supports DirectX and OpenGl 1.1 by default. You'll get this error, among others, if you don't have proper OpenGL drivers installed.
Try installing drivers from your graphics card's vendor web site (not the ones installed by Windows automatically), which should include a proper opengl32.dll.
Using Qt with ANGLE would also solve it, if this is your problem.

OpenGL program does not compile with QT 5.0

I followed this turial to create a very simple openGL program with QT.
I have QT 5.0. I created a new empty QT project, created all files as in the tutorial but the compilation failed. The cause is that certain methods like glShadeModel() are not recognized.
I tried include GL/glu.h (which include glShadeModel for instance) but this time there is a conflict with several openGL types. But according to the tutorial all opengl methods should be included in QtOpenGL. Maybe I have a too much recent version of QT. I'm lost.
Does anyone can help me ?
Qt5 is based on OpenGL ES 2.0, and this is a subset of desktop OpenGL, even some Qt tutorials are not adapted to this change yet. You will have to build Qt 5.0 with normal OpenGL if you wish to compile those tutorials.
i may only give you some points to check.
in .pro
*QT += opengl
*check your GPU for supporting the opengl version you are using, for example my laptop is only compatible with 2.1 opengl.
also please use "Qt" instead "QT", QT stands for quicktime by Apple.

Appearance difference between Qt4 and Qt5

I use Ubuntu 12.10 64 bit. I installed Qt4 from Ubuntu repo.
Version is Qt 4.8.3 and Qt Creator 2.5.2
I also downloaded Qt5 from qt-project.org and its version number is
Qt 5.0.1 and Qt Creator 2.6.2
When I compiled and run same project, their appearance slightly different.
What is the reason for that? Is it because of Ubuntu or Qt5?
Qt5 brought in some major changes of the GUI code, if you spot differences it's likely to be down to that rather than anything else.
New graphics architecture. Qt 5 introduces a new graphics architecture for Qt Quick using Scenegraph on top of OpenGL. OpenGL (ES) 2.0 is mandated for this to work. The new architecture makes it easier to integrate OpenGL-based content, such as shader effects, with Qt Quick-based applications. The QWidget-based stack continues to work as in Qt 4.x (based on QPainter), but supported back-ends have been limited to SW rasterization, pixmaps, and images, an OpenGL backend for GL surface,s and a backend for PDF generation and printing. X11 and CoreGraphics are no longer supported.
From Dr Dobbs Qt5 beta tour.

Resources