Yocto: QtMultimedia does not build qtmultimedia-plugin - qt

I am currently working on a Yocto build for an embedded system that needs Qt.
It must also have audio capabilities in the form of gstreamer + alsa.
We accomplished the first part by introducing Qt, gstreamer and all the necessary Qt plugins.
We are having troubles with alsa because the needed QtAudio plugin is, somehow, not built at all. The library I am refering to is /usr/lib/qt5/plugins/audio/libqtaudio_alsa.so which, for some reason does not get built.
We are currently trying to build Qt 5.6 but we have tryied with Qt 5.9 and everything works smoothly.
With Qt 5.9 we just had to add IMAGE_INSTALL += "qtmultimedia" for the library to show up because the PACKAGECONFIG for qtmultimedia already has alsa inside it (bitbake qtmultimedia -e | grep ^PACKAGECONFIG).
The problem with the Qt 5.6 build is that it still has alsa inside PACKAGECONFIG but does not build the library. With the help of Toaster we have tracked down this library as generated by qtmultimedia-plugins but we really do not know where to head next.
If anybody has ever had a problem similar to the one we are facing, please do not fear to comment or answer directly.
EDIT: Just to clear things up I have added some screenshots from Yocto's Toaster that clearly show the problem I'm facing.
The following screenshot is a build I have done previously with Qt 5.9 where qtmultimedia-plugins are built correctly and the library I'm seeking for is present.
The following two screenshots are the current build that I am trying to finish with qt 5.6 and where the qtmultimedia-plugins is built but no library is found.

Related

Qtquick - QML Module not found

I am getting started with qt and especially qt quick now and wanted to do the example from here: https://doc.qt.io/qt-5/qtquick3d-simple-example.html
However already the line import QtQuick3D 1.15 has been giving me headaches. The error that is printed says QML Module not found (QtQuick3D). If I am trying to import other things, I get the corresponding errors.
The error message also tells me "for qmake projects use the QML_IMPORT_PATH variable to add import paths" however I don't know what path and how I should set this?
Another solution I have seen is the one suggested here: https://stackoverflow.com/a/64952178/13533641.
Again I am unsure which path to add here. I tried "/usr/lib/qt5/bin" and "/home/Qt/5.15.2/gcc_64/bin". After setting the value I restarted Qt Creator but the error remained.
The project I have been using is an empty QT Quick application which you get if you create a new project. I just added that one import line.
I have used the Mainainance Tools to check the plugins and I installed something that was named 3D. I am unsure if this is the "normal" qtwidget thing or the one I am trying to use in the code. (Or maybe there is no difference anyway, who knows)
I use qt version 5.15 right now but I also tried installing the 5.9 and 6. Everywhere I have the same problem.
My machine runs ubuntu 20.04 and I installed qt using the official download for linux.
If I am correct, it got installed in the directory /home/Qt.
Does anybody know how to solve this?
After trying different paths and versions of Qt, I found this this instruction here
However I only needed to follow until the picture of the mainaintance tool and not the building afterwards. Before I had already added the additional library for Qt3d. This enough wasn't enough apparently, after adding the Qt-shader tools it and conan it worked however.
I did this after yet another fresh installation of Qt (this time version 6) and it worked now.
Regarding the suggested change for the qml emulation layer: the path that is now set is /home/Qt/5.15.2/gcc_64/bin.
Hope this helps someone in the future!

Qt - QSharedMemory qipc files location

On Linux, Qt creates the following files in the /tmp directory when using QSharedMemory:
qipc_sharedmemory_mysharedmem5ffa537fd8798875c98e190df289da7e047c05
qipc_systemsem_mysharedmem5ffa537fd8798875c98e190df289da7e047c05
I have come across a problem where two different versions of the same software use two different locations for these files, making them incompatible. The "newer" version instead creates these files in the /tmp/username/ directory. I can't seem to figure out what causes this. Is this location defined by Qt itself, and if so, did it change across versions? Or can it somehow be configured by the user, and if so, where and how?
I think you are experiencing a known Qt bug, as reported in the official bug tracker here: https://bugreports.qt.io/browse/QTBUG-60771
Briefly, there was a change between Qt 5.6 and Qt 5.8 in the way QSystemSemaphore (which is used by QSharedMemory) creates its keys. It was discovered that the method used to create the keys may cause collisions.
The incompatibility is documented in the changelog for Qt 5.9 here: https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.9.0/?h=v5.9.0
[QTBUG-60771] Reverted a change that caused Qt 5.6 through 5.8 not to
connect to QSystemSemaphore and QSharedMemory created by running
applications using Qt earlier than 5.6. Unfortunately, this means that Qt
5.9 will not connect to 5.6-5.8.
You may experiment with the QSharedMemory::setNativeKey() method to force your own keys (and thus, file names in the /tmp directory). Although this means you should modify and recompile both versions of your software.
I'm afraid the "official" solution is to ensure you only use one version of Qt at the time.

Qt 5.9 QtWebKit not installed

I just installed Qt Creator 5.9 and 5.3. I decided to somehow copy the plugin/module/source files for QtWebKit from 5.3 to 5.9. Basically, I "ported it", but without any success. It just keeps bringing up the error:
QT module(s) not installed: webkit
What version of Qt should I use in order to build iOS, Android and Windows mobile applications with QtWebView? I can't wrap my head around how this works. If anyone can direct me to a working environment with QML QtWebView module fully installed or can tell me what I missed in my "porting", I would really appreciate it since I really can't find any solution to this problem, no matter how much time I spend searching on google.
Thank you!

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.

Adding Qt Sources to QtCreator 2.4.1

I am currently using QtCreator 2.4.1 with Qt 4.7.4 development libraries (in Ubuntu) and am trying to track down a bug which after profiling with valgrind seems to occur internally within QGraphicsView::paintEvent(…) method
To help isolate this problem I would like to step into the Qt sources. Having done some searching through both the Qt forums and stack overflow and have not being able to find a way to integrate the sources with my version of QtCreator.
I have currently tried downloading the sources via the QtSDK manager and adding a “Source Path Mapping” within Tools->Options->Debugger. I am sure that this step is where I am making a mistake as I am unable to even switch to source when viewing internal Qt header files i.e. from QGraphicsView.h
I have so far tried adding the following Source Path Mappings
Source Path=/var/tmp/qt-src
TargetPath=/home/paul/QtSDK/QtSources/4.7.4
and
Source Path=/var/tmp/qt-src
TargetPath=/home/paul/QtSDK/QtSources/4.7.4/src
Neither works.
I have also tried building Qt directly from source, adding this to my "Qt versions" list within Qt Creator and creating a new project configuration using this version. This also did not work.
Likewise I have tried adding the src folders to my gdbinit file. This also fails to work.
I am completely lost with this.
Paul
Someone asked a similar question here: Need to step into Qt sources (my IDE is Qt Creator).
Someone else asked about Valgrind errors with Qt here: Suppression files for Qt memory leaks with Valgrind
And here is a little more info about Using Valgrind with Qt Creator along with some explanation about how to read the results. Its a little dated from late 2010.
Related Suggestions
I wouldn't debug the QGraphicsView class just because of all the effort to make it work or find the problem might be for nothing... Qt is moving to using the SceneGraph as the backend for QML and the rendering engine for QGraphicsView might become obsolete.
Updating to the latest stable build of the Qt libraries may make a big difference for QGraphicsView.
If you post the valgrind error you are getting to the Qt Trolls, someone might be able to explain what is going on for you.
There are other debugging techniques besides the traditional debugger. I've been programming in Qt in Windows (without valgrind) and with a large multi-threaded application, that loads a bunch of Dll's. I've had to put some faith into the Object Tree Model clean up and work on all the new calls I put in. Most of the time I just use QDebug to find errors. Then I am also using a combination of qInstallMessageHandler() with QDebug to implement decent logging for the hard to track bugs.
See also Qt Debugging Techniques.

Resources