Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cross-platform Qt data visualization apps really possible?
Has anyone run the same Qt data visualization app on both Android and a desktop? Qt claims to provide application cross-platform portability, but after several weeks evaluation I've been unable to demonstrate it.
I want to develop apps that use the Qt data visualization framework, such as Q3DSurface, and I want the same app to run on a ubuntu desktop with a mouse as well as on an Android phone. Qt advertises this dual-platform capability and I hoped to demonstrate it using the examples provided by Qt version 5.13.0, but have been unsuccessful. Of the Qt data visualization examples It seems that Quick Qt examples run on Android, Qt Widget examples run on my ubuntu 16.04 desktop, but I have not found any data visualization example that runs on both platforms. Specifically I see the following:
Qt widget examples such as surface and texturesurface run on the ubuntu desktop, but do not run properly on Android v 8.0.0. On Android those apps actually start up and display the Q3DSurface properly, but do not respond to touch events to rotate or zoom the display.
Qt Quick examples such as qmlsurface run on Android, but do not run on the ubuntu desktop, where they exit with "OpenGL version is too low, at least 2.1 is required". This error is displayed despite the fact that the desktop is running OpenGL version 4.5.
I've tried a few in-code approaches to address the above without success. Cross-platform app portability is a requirement for my project, and it's looking like Qt cannot provide that. Has anyone achieved it? Any advice or examples are much appreciated!
The error message appears to come from the following source:
My guess is that you compiled Qt yourself and did not have the right include files present for opengl.
If I use the Qt 5.13.0 from their download, this example works fine on ubuntu 19.04.
@skycrestway I downloaded the open source from the Qt online downloader page, which provided me with qt-unified-linux-x64-3.1.1-online.run. I then executed that downloaded file, specified a local non-root Qt home directory, requested version 5.13.0, all of the developer/designer tools (Qt creator, etc). Is that how you installed Qt? Did I miss some step? E.g. is there a 'make install' I should do? Thanks for your feedback!
This is how I originally installed it for an Qt earlier version. Once installed there is a MaintainanceTool in the top Qt directory. I used it to install the 5.13.0 version. After running this tool, you choose "Add or remove components". You can then see what you have installed. Perhaps you are missing some package that is needed. The tool would also let you delete the 5.13.0 version and then run it again to reinstall that version.
@skycrestway - Is there is no 'make install' step I must run to put things in root-owned directories (e.g. /usr/local)? Also, can you please verify your OpenGL and Mesa versions (glxinfo command) ? I ask because the abstract3drenderer.cpp code that generates the "OpenGL version is too low" message is this:
m_funcs_2_1 = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_2_1>(); [...] if (!m_funcs_2_1) qFatal("OpenGL version is too low, at least 2.1 is required");
My ubuntu system is running OpenGL 4.5, and the request for OpenGL 2.1 functions returns nullptr (I don't understand why), which causes the failure. Is your system running OpenGL 2.1?
Thank you very much!
There is no make install step.
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.0.8
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 19.0.8
Here is a list of opengl packages with version information for my Ubuntu 19.04
Tom asso last edited by
I upgraded my ubuntu host to 18.04.2 - now Qt Quick data visualization examples run on ubuntu as well as Android without error. @skycrestway - thank you for providing the "existence proof" of this cross-platform capability!