Difference between revisions of "Qt/Embedded"

From ArmadeusWiki
Jump to: navigation, search
m (How to cross-compile an application using Qtopia)
m
Line 3: Line 3:
 
== Introduction ==
 
== Introduction ==
  
This page will summarize the process to build, install and use Qtopia.
+
This page will summarize the process to build, install and use Qtopia (previously known as Qt/Embedded).
  
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.
+
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.
  
 
==Installation==
 
==Installation==
  
 
From November 20th 2007, Qtopia is now fully integrated in Armadeus Buildroot. So to install it you have to:
 
From November 20th 2007, Qtopia is now fully integrated in Armadeus Buildroot. So to install it you have to:
 
+
<pre class="host">
 
  [armadeus]$ make menuconfig
 
  [armadeus]$ make menuconfig
 +
</pre>
  
[[Image:Menuconfig_package.png]]
+
{{BuildrootPackageGraphicsConfig}}
<br>then
+
  
[[Image:Menuconfig_package_graphics.png]]
 
 
<br> and then
 
<br> and then
  
Line 24: Line 23:
  
 
then:
 
then:
 +
<pre class="host">
 
  [armadeus]$ make
 
  [armadeus]$ make
 +
</pre>
  
1hour and 800MBytes later your will have the beast.
+
1 hour (depending on your system) and ~1 GBytes later your will have the beast.
If you want to test it, reflash your rootfs, and put some examples in your NFS shared directory:
+
If you want to test it, reflash your rootfs, compile and put some examples in your TFTP directory:
  [armadeus]$ cp buildroot/build_armv4t/qtopia-core-opensource-src-4.3.1/examples/widgets/calculator/calculator \
+
<pre class="host">
                /local/export/usr/bin
+
  $ cd buildroot/build_armv4t/qtopia-core-opensource-src-4.3.1/examples/widgets/
 +
$ qmake widgets.pro
 +
$ make
 +
...
 +
$ cp calculator/calculator /tftpboot
 +
</pre>
 
and then launch it on your APF:
 
and then launch it on your APF:
  # /mnt/nfs/usr/bin/calculator -qws
+
<pre class="host">
 +
  # cd /usr/bin/
 +
# tftp -g -r calculator 192.168.0.xx (Host IP)
 +
# calculator -qws
 +
</pre>
 +
 
  
  
Line 153: Line 164:
 
* 16 colors framebuffer with Qt: http://lists.trolltech.com/qt-embedded-interest/2003-11/msg00007.html
 
* 16 colors framebuffer with Qt: http://lists.trolltech.com/qt-embedded-interest/2003-11/msg00007.html
  
<br>[[Image:FrenchFlag.png]] [[Fr:Qt/Embarqué | Cette page en français]]
+
{{LanguageBar|Qt/Embedded|Qt/Embarqué|Qt/Embedded}}
  
 
[[Category: Software]]
 
[[Category: Software]]
 
[[Category: Graphical User Interface]]
 
[[Category: Graphical User Interface]]

Revision as of 19:46, 7 February 2009

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

Introduction

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

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.

Installation

From November 20th 2007, Qtopia is now fully integrated in Armadeus Buildroot. So to install it you have to:

 [armadeus]$ make menuconfig
Package Selection for the target  --->
    [*] Graphic libraries and applications (graphic/text)  --->


and then

Menuconfig package qtopia.png

(don't forget -depths 8,16 option)

then:

 [armadeus]$ make

1 hour (depending on your system) and ~1 GBytes later your will have the beast. If you want to test it, reflash your rootfs, compile and put some examples in your TFTP directory:

 $ cd buildroot/build_armv4t/qtopia-core-opensource-src-4.3.1/examples/widgets/
 $ qmake widgets.pro
 $ make
 ...
 $ cp calculator/calculator /tftpboot

and then launch it on your APF:

 # cd /usr/bin/
 # tftp -g -r calculator 192.168.0.xx (Host IP)
 # calculator -qws



!!! FOLLOWING INSTRUCTIONS ARE OBSOLETE AND HERE ONLY FOR HISTORICAL PURPOSE !!!


Requirements

You must install the libc++ on your target. If you want to use the Qt Gui module, you must have the libpng package (select it in the menuconfig in buildroot).

Getting the packages

You must get the packages qtopia-core-opensource-src-4.2.0.tar.gz & qt-x11-opensource-src-4.2.0.tar.gz from the ftp server of the trolltech company as anonymous user (no password)

# ftp ftp.trolltech.com
# Name (ftp.trolltech.com:user): anonymous
# cd /qt/source
# get qtopia-core-opensource-src-4.2.0.tar.gz
# get qt-x11-opensource-src-4.2.0.tar.gz
# quit

or use the wget command:

# wget --user=anonymous ftp.trolltech.com:/qt/source/qtopia-core-opensource-src-4.2.0.tar.gz
# wget --user=anonymous ftp.trolltech.com:/qt/source/qt-x11-opensource-src-4.2.0.tar.gz

Installation

From now, we consider the variable ARMADEUS_ROOT_DIR as the root directory of the Armadeus SVN snapshot on your computer.

Copy and untar the downloaded packages into an installation folder called qt_installs:

# cd $ARMADEUS_ROOT_DIR
# mkdir qt_installs
# cp $DOWNLOAD_FOLDER/qtopia-core-opensource-src-4.2.0.tar.gz   \ 
   $DOWNLOAD_FOLDER/qt-x11-opensource-src-4.2.0.tar.gz $ARMADEUS_ROOT_DIR/qt_installs
# tar fxz qtopia-core-opensource-src-4.2.0.tar.gz
# tar fxz qt-x11-opensource-src-4.2.0.tar.gz

First you may install/update Qt 4.2 on your system if is not installed yet because you will need the Qt tools ( the designer for instance ....). Additionally you must compile and install the qvfb and qconfig tools. ....

# cd qt-x11-opensource-src-4.2.0
# ./configure
# make
# su root
# make install
# cd tools/qvfb/ ; make
# install -m 755 -p ../../bin/qvfb /usr/local/Trolltech/Qt-4.2.0/bin
# cd ../qconfig ; make
# install -m 755 -p qconfig /usr/local/Trolltech/Qt-4.2.0/bin 
# make confclean

Then as user, configure, compile the Qtopia package for the virtual frame buffer installation. Once done, install all these into the $ARMADEUS_ROOT_DIR/qt/qvfb folder

# cd qtopia-core-opensource-src-4.2.0
# ./configure -depths 8,16,32 -no-cups -release  -qvfb -prefix \
   $ARMADEUS_ROOT_DIR/qt/qvfb -no-qt3support
# make
# su root
# make install
# make confclean

Now, as user, the essential: Qtopia

# ./configure -embedded arm -little-endian -depths 8,16,32 -no-cups -release \
   -fast -qconfig medium -prefix $ARMADEUS_ROOT_DIR/qt/qtopia.4.2.0
# make
# make install

Note: the compilation/installation of the Qtopia demos may not work, but all the Qt libraries are well done.

To install one or several different configurations, please read the Qt documentation included to understand the different configuration options. I advise you to preserve the qt_installs/qtopia-core-opensource-src-4.2.0 installation folder. Indeed, you may install Qtopia again in the following cases:

  • You are using a new arm-linux-g++ compiler version
  • You need several different installations because you are working on different projects ( For example the LCD properties are different).
  • You want to add the Qt3 support
  • you want to resize the Qt libraries to save some space on your rootfs.

Usage

by default Qt is installed in /usr/lib/ directory of your target rootfs before launching Qt on the target, you should set following env variables to the right value: QTDIR, LD_LIBRARY_PATH, etc... To be completed ......

How to cross-compile an application using Qtopia

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....

Work in progress / to do list

  • target installation = integration in Buildroot
  • examples & demos
  • Customization of the Qt libs to have a custom Qt/E library well designed for Armadeus usage.

Links

Other languages:

English Flag.svg English  •  French Flag.svg Français