Qt/Embedded

From ArmadeusWiki
Revision as of 11:00, 18 August 2010 by JeremieS (Talk | contribs)

Jump to: navigation, search

Instructions to install and use QtEmbedded & Qt virtual frame buffer for Armadeus

Introduction

This page will summarize the process to build, install and use Qt Embedded (previously known as Qtopia).

You will also find instructions to setup a Host development environment for simulating applications before deploying them on the target (Qt virtual frame buffer). The Builroot tree must be installed before the installation of Qt.

Note Note: We recommand at least 32 MBytes of RAM if you plan to design and run Qt based GUIs.


Installation

From November 20th 2007, Qt Embedded is now fully integrated in Armadeus Buildroot (old procedure is kept here). So to install it you have to:

 [armadeus]$ make menuconfig
[*] Graphic libraries and applications (graphic/text)  --->
    *** other GUIs ***
    [*]   Qt  --->
        --- Qt
        [ ]   Compile with debug support
              Library type (Shared library)  --->
        [*]   Approve free license
        [ ]   Compatibility with Qt3
        [*]   Gui Module
                Pixel depths  --->
                Fonts  --->
                freetype2 support (no freetype2 support)  --->
        [*]     Enable GIF support
        [ ]     Enable libmng support
                JPEG support (System libjpeg)  --->
                PNG support (No PNG support)  --->
                TIFF support (No TIFF support)  --->
              zlib support (Qt zlib)  --->
        (arm) The embedded platform we are making Qt for
        [ ]   SQL Module  ---> 
              Graphics drivers  --->
              Mouse drivers  --->
              Keyboard drivers  --->
        [ ]   Phonon Module
        [*]   XML Module 
        [ ]     XML Patterns Module
        [ ]   SVG Module
        -*-   Network Module
        [ ]     WebKit Module
        [ ]   STL support
        [ ]   Enable OpenSSL support
        [*]   Script Module
        [ ]     Script Tools Module

(don't forget Pixel depths submenu options (at least 8 and 16))

  • If you want touchscreen support:
    Mouse drivers  --->
        ...
        [*] tslib

then:

 [armadeus]$ make

1 hour and ~1 GBytes later (depending on your system and the configuration you choosed) your will have the beast. You can then reflash your rootfs.

Test

If you want to test it, compile and put some examples in your TFTP directory:

$ make shell_env
$ source armadeus_env.sh
$ cd $ARMADEUS_QT_DIR/examples/widgets/
$ $ARMADEUS_QT_DIR/bin/qmake widgets.pro
$ make
...
$ cp digitalclock/digitalclock /tftpboot
$ cp calculator/calculator /tftpboot

and then launch it on your APF (supposed you have a running & calibrated touchscreen):

# cd /usr/bin/
# tftp -g -r calculator 192.168.0.xx (Host IP)
# chmod a+x calculator
# export QWS_MOUSE_PROTO="Tslib:/dev/input/event0"
# 
# ./calculator -qws

Demo

A client/server (with GUI) demo is available under: software/demos/ApfDacClientServer/. It could be a good starting point to show you how to create standalone Qt applications (will probably require some modifications in src/build.sh depending on your Host Qt installation).

GUI with widgets taken from http://www.qt-apps.org

Usage

By default Qt libraries are installed in /usr/lib/ directory of your target rootfs.

How to cross-compile an application using Qt Embedded

Warning Warning: FOLLOWING INSTRUCTIONS ARE OBSOLETE AND NEED TO BE CHECKED !!


The first thing you need to do is to define a specific "qmake specs directory" for armadeus. Here for example:

mkdir $APPLICATION_ROOT_DIR/mkspecs/linux-arm-g++

and install the two following files into this new directory: qmake.conf & qplatformdefs.h. qmake.conf may be customized if necessary.


Then, you must define two typical environment variables : QTDIR which defines the Qtopia installation path & QMAKESPEC which defines the path to the configuration files of the qmake tool

Here two typical lines of a Qtopia application building script

export QTDIR=/home/demo/demos/Buitinqt/buildroot/build_armv4t/qtopia-core-opensource-src-4.3.1/
export QMAKESPEC= $APPLICATION_ROOT_DIR/mkspecs/linux-arm-g++

Adapt the QTDIR path to your own installation path and compile your code now, using theses commands:

# build the makefile with the qmake command (See Trolltech documentation for details about qmake):
qmake -spec $QMAKESPEC my.pro
# and now compile the beast... :
make

Good luck....

Phonon installation with Qt Embedded

Work in progress / to do list

  • Customization of the Qt libs to have a custom Qt/E library well designed for Armadeus usage.

Licenses

Since Qt 4.5.2 new licensing schemes are available: http://www.qtsoftware.com/products/licensing/licensing#qt-gnu-lgpl-v

Links