Skip to main content

Qt User Guide

Introduction

Qt is a cross platform C++ framework (C++ library) primarily used for developing graphical user interface (GUI) programs, as well as command line (CUI) programs without interfaces. OpenGL ES (OpenGL for Embedded Systems) is a cross platform 2D/3D graphics API interface suitable for rendering efficient 2D and 3D graphics on low power devices, which are tailored for embedded devices using OpenGL (Open Graphics Library). This Qt User Guide guides users to adapt Qt5's OpenGL ES hardware acceleration on the Spacemit Soc platform.

Install Qt5 development environment

Install C/C++ compilation environment

$ sudo apt-get update
$ sudo apt-get install build-essential

Install Qt5 development tool

$ sudo apt-get install qtbase5-gles-dev qtchooser qt5-qmake qtbase5-dev-tools

Check the installation of Qt version.

$ qmake -v
QMake version 3.1
Using Qt version 5.15.13 in /usr/lib/riscv64-linux-gnu

Install Qt5 wayland plugin

$ sudo apt-get install qtwayland5

Configure Qt5 backend display service

$ export QT_QPA_PLATFORM=wayland

Build and run Qt5 program

Download base-opensource-src-gles

$ apt-get source qtbase-opensource-src-gles
$ tree qtbase-opensource-src-gles-5.15.13+dfsg -L 1
qtbase-opensource-src-gles-5.15.13+dfsg
├── bin
├── config_help.txt
├── config.tests
├── configure
├── configure.bat
├── configure.json
├── configure.pri
├── debian
├── dist
├── doc
├── examples
├── include
├── INSTALL
├── lib
├── LICENSE.FDL
├── LICENSE.GPL2
├── LICENSE.GPL3
├── LICENSE.GPL3-EXCEPT
├── LICENSE.LGPL3
├── LICENSE.LGPLv3
├── LICENSE.QT-LICENSE-AGREEMENT
├── mkspecs
├── qmake
├── qtbase.pro
├── src
├── sync.profile
├── tests
└── util

Build qtbase-opensource-src-gles

Install dependencies

$ sudo apt-get build-dep qtbase-opensource-src-gles

Build

$ dpkg-buildpackage -us -uc -nc -b -j4

Build examples

Generate Makefile using qmake

$ cd qtbase-opensource-src-gles-5.15.13+dfsg/examples/widgets/animation/animatedtiles
$ qmake

Generate executable files using make

$ make

Run examples

$ ./animatedtiles

qt