Adding the Qt5 Layer

I have a few questions about the Adding the Qt5 Layer section of the following document: How to set up Qt Creator to cross compile for embedded Linux.

The Adding the Qt5 Layer section states the following:

Starting with V2.6 meta-qt5 is part of the layers which get set up and the manual cloning and change to bblayers.conf is not longer needed.

Does this mean that nothing additional must be done to include the meta-qt5 layer into the embedded Linux that we are using which is built by running the following command from that same document?:

bitbake -k angstrom-lxde-image

The following is also from the same document linked above:

For images starting with V2.7 Qt 5.7 qtbase-fonts package is no longer provided. So don’t add qtbase-fonts to IMAGE_INSTALL. If you need fonts make sure fonts are installed and qtbase is compiled with PACKAGECONFIG fontconfig so they get found.
PREFERRED_PROVIDER_psplash-support = “psplash-angstrom”
+
+IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts"
+PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

Is it necessary to include these lines? If they are included in the local.config file do I need to run the command: bitbake -k angstrom-lxde-image again?

I just want to make sure that the meta-qt5 layer is actually being built into our embedded Linux image because whenever I build a Qt Widgets application using Qt Creator, or any type of application, the application builds and deploys to the device successfully, but it will not run. When launching the application on the device using the display nothing happens. There is no ouput to state what is going on, and I see no serial output to my PC that might provide any information as to why the application is failing to run.

Also, when I try to run the application from an LXTerminal on the device I see the following output:

/opt/bin/HelloWorld/HelloWorld: cannot execute binary file

I have made sure that the executable permission for the file is set to allow it to run. I have a feeling that the necessary qt5 libraries are not in our embedded Linux image which is why I’m having this issue, but I’m not sure.

Also in the doument I see:

${TOPDIR}/…/stuff/meta-openembedded/meta-systemd
${TOPDIR}/…/stuff/meta-openembedded/meta-networking
${TOPDIR}/…/stuff/meta-openembedded/meta-multimedia \

  • ${TOPDIR}/…/stuff/meta-openembedded/meta-ruby
    ${TOPDIR}/…/stuff/meta-lxde
    ${TOPDIR}/…/stuff/meta-browser \
  • ${TOPDIR}/…/stuff/meta-qt5 \

Everything in my local.conf file is the same as above except the line: *${TOPDIR}/…/stuff/meta-openembedded/meta-ruby * is replaced with: *${TOPDIR}/…/stuff/meta-openembedded/meta-python *

Is Python now used in place of Ruby, or do I need to make the change?

Any information that anyone can provide would be greatly appreciated.

Thank You.

If you repo synced to LinuxImageV2.7, meta-qt5 layer is already included. Which image did you exactly build and flash on Colibri iMX7? Did you build angstrom-lxde-image or did you build angstrom-qt5-x11-image as I recommended in another thread?

If you build angstrom-qt5-x11-image, the local.conf needs to only have this added

PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

and if you build angstrom-lxde-image, the local.conf needs to have

IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts"
PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

angstrom-qt5-x11-image will have the Qt libraries included which is not the case for angstrom-lxde-image as a result of which the required Qt libraries have to specified. Please check the image you are building.

One can also check for the presence of Qt libraries on the module with

ls /usr/lib/ | grep -i "libqt"

I have a few questions about the Adding the Qt5 Layer section of the following document: How to set up Qt Creator to cross compile for embedded Linux.

The Adding the Qt5 Layer section states the following:

Starting with V2.6 meta-qt5 is part of the layers which get set up and the manual cloning and change to bblayers.conf is not longer needed.

Does this mean that nothing additional must be done to include the meta-qt5 layer into the embedded Linux that we are using which is built by running the following command from that same document?:

bitbake -k angstrom-lxde-image

No.
It means that starting with V2.6 you have the meta data which meta-qt5 provides already available in your OE setup BUT that does not mean that any package gets additionally added and deployed if you build an image recipe.

So with that change you no longer have to clone meta-qt5’s git repo and you no longer have to edit the build/conf/bblayers.conf file.

The following is also from the same document linked above:

For images starting with V2.7 Qt 5.7 qtbase-fonts package is no longer provided. So don’t add qtbase-fonts to IMAGE_INSTALL. If you need fonts make sure fonts are installed and qtbase is compiled with PACKAGECONFIG fontconfig so they get found.
PREFERRED_PROVIDER_psplash-support = “psplash-angstrom”
+
+IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts"
+PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

Is it necessary to include these lines?

I assume you use 2.7, so yes.

If they are included in the local.config file do I need to run the command: bitbake -k angstrom-lxde-image again?

Yes, with these additional two lines in build/conf/local.conf you get our regular LXDE based image with the additionally of Qt5 libraries and the cinematicexperience Qt5 application.

I just want to make sure that the meta-qt5 layer is actually being built into our embedded Linux image because whenever I build a Qt Widgets application using Qt Creator, or any type of application, the application builds and deploys to the device successfully, but it will not run. When launching the application on the device using the display nothing happens. There is no ouput to state what is going on, and I see no serial output to my PC that might provide any information as to why the application is failing to run.

Also, when I try to run the application from an LXTerminal on the device I see the following output:

/opt/bin/HelloWorld/HelloWorld: cannot execute binary file

What is the output of

file /opt/bin/HelloWorld/HelloWorld
ldd /opt/bin/HelloWorld/HelloWorld

And cinematicexperiance is a Qt5 application which is built and deployed in the image by the IMAGE_INSTALL_append line above, so does

Qt5_CinematicExperience

start an application?

I have made sure that the executable permission for the file is set to allow it to run. I have a feeling that the necessary qt5 libraries are not in our embedded Linux image which is why I’m having this issue, but I’m not sure.

Did you check?
e.g. what is the output of

ls -l /usr/lib/libQt5Core.so*

Also in the doument I see:

${TOPDIR}/…/stuff/meta-openembedded/meta-systemd \ ${TOPDIR}/…/stuff/meta-openembedded/meta-networking \ ${TOPDIR}/…/stuff/meta-openembedded/meta-multimedia \ + ${TOPDIR}/…/stuff/meta-openembedded/meta-ruby \ ${TOPDIR}/…/stuff/meta-lxde \ ${TOPDIR}/…/stuff/meta-browser \ + ${TOPDIR}/…/stuff/meta-qt5 \

Everything in my local.conf file is the same as above except the line: ${TOPDIR}/…/stuff/meta-openembedded/meta-ruby * is replaced with: ${TOPDIR}/…/stuff/meta-openembedded/meta-python *

Is Python now used in place of Ruby,

meta-ruby is no longer needed.
(meta-python was added for other reasons, not to replace meta-ruby)

or do I need to make the change?

No, you don’t need to add meta-ruby.

Max

Cool,

Thanks sanchayan.tx. The openembedded document is confusing as to what needs to be done in the area of Adding qt5, but your post here clears up the misunderstanding.

The document describes how to build the angstrom-lxde-image, but what we need is the angstrom-qt5-x11-image, and that’s fine I can build that image following your directions above.

Additionally the above document shows the build command: bitbake -k angstrom-lxde-image. I understand that I will be changing this to bitbake angstrom-qt5-x11-image now, but immediately below this line it states:

Build a single package and all things it depends on.

bitbake samba

I’m assuming that I don’t need to do this because I will be using the: bitbake angstrom-qt5-x11-image command?

I did run the terminal command that you specified above: ls /usr/lib/ | grep -i “libqt” and nothing was returned. There was no output. I assume this means the needed qt5 libraries were not built into our image, and that is why we are having issues running applications built with Qt Creator.

It sounds like what you have provided will solve our problem. I’ll let you know how everything goes.

Thanks again for clearing things up.

Also, the information in Toradex’s document here is confusing because it seems to be saying that: angstrom-lxde-image does indeed contain the needed Qt libraries and components. Here is the excerpt from that document:

On the target module you will need the Qt runtime environment installed. Therefor a new image with the Qt run-time libraries to allow executing Qt applications on the target is required.

For Qt 5, build and setup with OpenEmbedded as per High performance, low power Embedded Computing Systems | Toradex Developer Center

angstrom-lxde-image: Qt 5 X11 image with Angstrom LXDE desktop environment

I could find no mention in either the OpenEmbedded (core) document or the How to set up Qt Creator to cross compile for embedded Linux that discusses building the angstrom-qt5-x11-image which already includes the needed Qt libraries.

Thank You.

Thanks Max,

I appreciate the information that you provided. I am currently following the information in sanchayan.tx’s answer that he provided where he indicates to use the angstrom-qt5-x11-image which already includes the needed Qt libraries. I also added the line: PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig" to my local.conf file and started the build.

I’m waiting for the build to complete right now. I’ll let you know how things go. From your response and sanchayan.tx response it is obvious now that I was not including the necessary qt libraries into my embedded Linux build.

After I get everything built and running I’ll let you know how it went.

In Qt Creator, to build a non-qt quick 2, Widget only, application would I select “Qt Widgets Application” from the new project dialog box?

Thanks for all of your help.

I’ve tried building the the embedded Linux operating system according to your instructions above and it has not solved our issue. I added the line:

PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

to our local.conf file and built using

bitbake angstrom-qt5-x11-image

this took a long time, but built successfully, I have also built the SDK according to the Qt Creator cross-compile document.

I’ve updated the the image on the device, but the normal desktop has now been replaced with a Qt Smart Home Control screen that is not useful to us and I don’t seem to be able to get back to the Linux desktop where I can navigate the file system as I did before.

Also, I can establish a Test connection to the device in the Qt Creator IDE, but when I try to build and download a test application to the device, I now see the following output:

15:17:11: Running steps for project Hello_World…
15:17:11: Configuration unchanged, skipping qmake step.
15:17:11: Starting: “/usr/bin/make”
make: Nothing to be done for `first’.
15:17:11: The process “/usr/bin/make” exited normally.
15:17:11: Connecting to device…
15:17:21: Could not connect to host: Timeout waiting for reply from server.
Is the device connected and set up for network access?
15:17:21: Deploy step failed.
Error while building/deploying project Hello_World (kit: Toradex (Qt Embedded))
When executing step “Check for free disk space”
15:17:21: Elapsed time: 00:10.

This has taken us back several steps from where we were in successfully building an application and getting it downloaded to the device.

How do we remove the Qt Smart Home Control and get back to the desktop? Why is the desktop not showing up now?

Another problem we have is that the embedded Linux image that we load does not fit within our screen. The display is not fully used on the right side. It’s cutting off the Qt Smart Home Control window so we can’t see what is on the right side of the screen. We can’t see if there is a way to close out this window or not. When I first started working on this project I found a document online that indicated a way to properly setup a table of values to make sure that the display was configured properly in embedded Linux. What are the proper settings for this? I would have thought that this would have been set right already so that we could fully use the display that we purchased along with the Colibri Evaluation Board from Toradex.

angstrom-qt5-x11-image is a demo image which includes the Qt libraries and starts the Smart Home demo by default. It does not have a desktop environment as the LXDE image, however X is installed and running, so Qt applications can also be used without issues. The smart home demo can be disabled to run at startup by executing the below command

systemctl disable qt5-x11-demo

If you want to have the LXDE desktop environment, you would have to build the angstrom-lxde-image but using IMAGE_INSTALL_append as below in local.conf to add the Qt libraries as per requirement since the LXDE image does not include Qt libraries.

IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts"
PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

For deployment and connection issue, please recheck your deployment settings.

Another problem we have is that the embedded Linux image that we load does not fit within our screen. The display is not fully used on the right side. It’s cutting off the Qt Smart Home Control window so we can’t see what is on the right side of the screen.

What is the display you use and at what resolution?