Search by Tags

Qt Debian Container for Torizon

 

Article updated at 04 Jun 2020
Compare with Revision




Subscribe for this article updates

Introduction

Toradex provides Qt containers with the base Qt5 libraries installed. It makes it easy for you to extend this container with your application and its dependencies. See some advantages of using this container:

  • You can keep applications independent
  • Use different runtimes
  • Encapsulate application dependencies in the container
  • It will be easier to maintain

The following containers from Toradex are available:

  • debian-qt5-wayland: minimal container with Qt5 libraries. You should use it as the base for deploying your own app.
  • debian-qt5-wayland-examples: built on top of debian-qt5-wayland with qtbase5-examples and qtdeclarative5-examples. You can use it for a great out-of-the-box evaluation experience, as described in this article.

This article complies to the Typographic Conventions for Torizon Documentation.

Prerequisites

The following prerequisites are proposed:

Executing the Containers

Attention: please use the tag buster-20200415 if you are using the TorizonCore Monthly release from April, a.k.a 4.0.0-devel-202004+build.3. At the moment you should only use the tag buster if you are using a newer release of TorizonCore.

Run a Weston Container

Connect to the board terminal by establishing an SSH connection.

Start a Weston container which will be the graphics server. Choose your module from the tabs below and follow the instructions:

Start weston using the torizon/arm32v7-debian-weston:buster container image:

# docker run -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
             -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
             --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw'  --device-cgroup-rule='c 226:* rmw'\
              torizon/arm32v7-debian-weston:buster --developer weston-launch --tty=/dev/tty7 --user=torizon

Start weston using the torizon/arm32v7-debian-weston:buster container image:

# docker run -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
             -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
             --device-cgroup-rule='c 4:* rmw'  --device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 226:* rmw' \
              torizon/arm32v7-debian-weston:buster --developer weston-launch --tty=/dev/tty7 --user=torizon -- --use-pixman

Start weston using the torizon/arm64v8-debian-weston-vivante:buster container image:

Attention: Please, note that by executing the following line you are accepting the terms and conditions of the NXP's End-User License Agreement (EULA)

# docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
             -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
             --device-cgroup-rule='c 4:* rmw'  --device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
              torizon/arm64v8-debian-weston-vivante:buster --developer weston-launch --tty=/dev/tty7 --user=torizon

Run a Qt Wayland Container

Start a Qt Wayland examples container. It works on top of Wayland, as explained in Debian Containers for Torizon, and has Qt libraries. When you package your own application, use the base instead of the examples image to save flash storage space.

Select your module from the tabs below and follow the instructions:

Bring-up the Qt5 Wayland container:

# docker run --rm -it --name=qt5 \
             -v /tmp:/tmp \
             -v /dev/dri:/dev/dri --device-cgroup-rule='c 226:* rmw' \
             torizon/arm32v7-debian-qt5-wayland-examples:buster

Start a Qt Sample Application (32-bit SoCs)

Run any of the available applications to confirm that the Qt Wayland container is running successfully:

## /usr/lib/arm-linux-gnueabihf/qt5/examples/widgets/widgets/calculator/calculator &

or

## /usr/lib/arm-linux-gnueabihf/qt5/examples/widgets/widgets/shapedclock/shapedclock &

or

## /usr/lib/arm-linux-gnueabihf/qt5/examples/opengl/cube/cube &

Bring-up the Qt5 Wayland container:

# docker run --rm -it --name=qt5 \
             -v /tmp:/tmp \
             -v /dev/dri:/dev/dri --device-cgroup-rule='c 226:* rmw' \
             torizon/arm64v8-debian-qt5-wayland-examples:buster

Start a Qt Sample Application (64-bit SoCs with CPU only)

Run any of the available applications to confirm that the Qt Wayland container is running successfully:

## /usr/lib/aarch64-linux-gnu/qt5/examples/widgets/widgets/calculator/calculator &

or

## /usr/lib/aarch64-linux-gnu/qt5/examples/widgets/widgets/shapedclock/shapedclock &

or

## /usr/lib/aarch64-linux-gnu/qt5/examples/opengl/cube/cube &

Bring-up the Qt5 Wayland container:

Attention: Please, note that by executing the following line you are accepting the terms and conditions of the NXP's End-User License Agreement (EULA)

docker run -e ACCEPT_FSL_EULA=1 --rm -it --name=qt5 \
             -v /tmp:/tmp \
             -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore \
             --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
             torizon/arm64v8-debian-qt5-wayland-examples-vivante:buster

Start a Qt Sample Application (64-bit i.MX 8 SoCs with Vivante graphics acceleration)

Run any of the available applications to confirm that the Qt Wayland container is running successfully:

## /usr/lib/aarch64-linux-gnu/qt5/examples/widgets/widgets/calculator/calculator &

or

## /usr/lib/aarch64-linux-gnu/qt5/examples/widgets/widgets/shapedclock/shapedclock &

or

## /usr/lib/aarch64-linux-gnu/qt5/examples/opengl/cube/cube &

Also, please watch this video session for more information.