Difference between revisions of "Qt"

From ArmadeusWiki
Jump to: navigation, search
(Created page with "= Introduction = This page will summarize the process to build, install and use Qt on your APF board. It will focus on Qt5. = Compiling Qt = Select Qt5 from the BuildRoot m...")
 
m (Launching your Qt application)
 
(One intermediate revision by one other user not shown)
Line 45: Line 45:
 
* The qmake paths is '''buildroot/output/host/usr/bin/qmake'''
 
* The qmake paths is '''buildroot/output/host/usr/bin/qmake'''
  
= Launching you Qt application =
+
= Launching your Qt application =
 
If you want to use the tslib you need to active it first
 
If you want to use the tslib you need to active it first
 
<pre class="apf">
 
<pre class="apf">
Line 59: Line 59:
  
 
<pre class="apf">
 
<pre class="apf">
# ./flightinfo -plaform linuxfb
+
# /usr/lib/qt/examples/widgets/widgets/tetrix/tetrix -plaform linuxfb
 
</pre>
 
</pre>
  
 
The Qt Embedded [http://doc.qt.io/qt-5.6/embedded-linux.html documentation] describes all the options you can pass to the Qt framework.
 
The Qt Embedded [http://doc.qt.io/qt-5.6/embedded-linux.html documentation] describes all the options you can pass to the Qt framework.

Latest revision as of 16:13, 3 November 2016

Introduction

This page will summarize the process to build, install and use Qt on your APF board. It will focus on Qt5.

Compiling Qt

Select Qt5 from the BuildRoot menuconfig

Target packages --->
   Graphic libraries and applications (graphic/text) --->
      [*] Qt5 --->

Under the Qt5 submenu, you can select the features and Qt modules you need. The most important ones are described below.

Select the following option to accept de free license of Qt. If you don't select the option here, the building of Qt will stop and ask you to accept it.

[*] Approve free license

To dispaly UI you will need the gui module and the widgets module. You need to select de graphical platform you want. For example linuxfb for the framebuffer. You can also set the default graphical platform here instead of passing to your Qt application with the -platform parameter.

[*] gui module
[*]   widgets module
-*-   linuxfb support
...
(linuxfb)    Default graphical platform

To support the touchscreen, enable Tslib support.

[*]    Enable Tslib support

You can then select the Qt modules you need. For example:

  • qt5xmlpatterns if you need to read or write XML files.
  • qt5serialport if you need to use UARTs from you Qt application

Compiling your Qt application

Once Qt is compiled, you need to compile and deploy your application. You can do this from Qt Creator. You need to create a "Kit" for your APF board. See the Qt Creator documentation You will need the following informations:

  • The debugger path is buildroot/output/host/usr/bin/arm-linux-gnueabihf-gdb
  • The compiler path is buildroot/output/host/usr/bin/arm-linux-gnueabihf-g++
  • The qmake paths is buildroot/output/host/usr/bin/qmake

Launching your Qt application

If you want to use the tslib you need to active it first

export QT_QPA_FB_TSLIB=1 # for the framebuffer backend
export QT_QPA_EGLFS_TSLIB=1 # for openGL backend

and specify the input device

export TSLIB_TSDEVICE=/dev/input/event0
# /usr/lib/qt/examples/widgets/widgets/tetrix/tetrix -plaform linuxfb

The Qt Embedded documentation describes all the options you can pass to the Qt framework.