Search by Tags

Qt Debian Container for Torizon

 

Article updated at 03 Jun 2020
Compare with Revision



Subscribe for this article updates

Introduction

Toradex provides a Qt container 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

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 evaluating one of TorizonCore's nightly releases from the CI feeds.

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 container. It works on top of Wayland, as explained in Debian Containers for Torizon, and has Qt libraries. 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:buster

Start a Qt Sample Application (32-bit SoCs)

Install the qtbase5-examples package:

## apt update && apt install qtbase5-examples

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:buster

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

Install the qtbase5-examples package:

## apt update && apt install qtbase5-examples

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-vivante:buster

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

Install the qtbase5-vivante-examples package:

## apt update && apt install qtbase5-vivante-examples

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.