Icon  Name                                                                            Last modified      Size  Description
[DIR] Parent Directory - [DIR] archive/ 20-Mar-2011 09:20 - [DIR] core-edition/ 13-Mar-2011 22:33 - [DIR] next/ 30-Mar-2011 08:59 - [DIR] toolchain-extras/ 12-Mar-2011 08:48 - [   ] angstrom-2011.03-i686-linux-armv5te-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 20-Mar-2011 09:22 134M [   ] angstrom-2011.03-i686-linux-armv5te-linux-gnueabi-toolchain.tar.bz2 18-Mar-2011 09:13 43M [   ] angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 20-Mar-2011 09:27 134M [   ] angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain.tar.bz2 18-Mar-2011 09:22 43M [   ] angstrom-2011.03-x86_64-linux-armv5te-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 18-Mar-2011 09:46 137M [   ] angstrom-2011.03-x86_64-linux-armv5te-linux-gnueabi-toolchain.tar.bz2 17-Mar-2011 18:59 46M [   ] angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 18-Mar-2011 09:19 138M [   ] angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2 17-Mar-2011 12:21 47M [CMP] angstrom-eglibc-i686-armv7a-vfp-neon-v2012.12-toolchain.gz 29-May-2013 19:34 66M [   ] angstrom-eglibc-x86_64-armv7a-v2012.05-toolchain.tar.bz2 16-Aug-2012 11:34 71M [CMP] angstrom-eglibc-x86_64-armv7a-vfp-neon-v2012.12-toolchain.gz 29-May-2013 19:35 67M [TXT] readme.html 21-Apr-2010 11:33 7.5K

Creating and Using a Qt Embedded SDK

Creating the SDK

The SDK should contain a build of Qt Embedded, but also optional dependencies like directFB, glib-2.0, gstreamer-0.10, tslib and more esoteric dependencies like mysql and postgres. This allows developers to simply start developing using Qt and enables system integrator to easily recompile Qt and base libraries without tracking down extra dependencies.

OpenEmbedded provides an easy way to create a Qt Embedded SDK. In recipes/tasks/task-qte-toolchain-host.bb host tools like moc, uic, rcc, qmake will get installed and in recipes/tasks/task-qte-toolchain-target.bb the Qt4 header files and libraries will be installed.

To build the SDK, setup OpenEmbedded in the usual way by picking a DISTRO and MACHINE. Issue the below command and after the operation finished you should find a SDK in the deployment directory.

$ bitbake meta-toolchain-qte

Note

The deployment directory depends on the distribution and used C library. In the case of Angstrom and glibc it is located in tmp/deploy/glibc/sdk.

Note

Change qt4-embedded.inc and qt4.inc for using different Qt configuration flags. This might include a custom qconfig.h to produce a reduced size build.

Note

When distributing the SDK make sure to include a written offer to provide the sourcecode of GPL licensed applications or provide parts of the sources folder. The sources folder is located right next to the sdk one.

Using the Qt Embedded SDK

In this example we are assuming that the target hardware is an armv5t system and the SDK targets the Angstrom Distribution. You should start by downloading the SDK and untar it to the root folder (/). Once this operation is finished you will find a new directory /usr/local/angstrom/arm/ and it contains the environment-setup to setup the QMAKESPEC and various other paths.

Untar the SDK once
$ tar -C / -xjf angstrom-armv5te-linux-gnueabi-toolchain-qte.tar.bz2

Before using it source the environment
$ . /usr/local/angstrom/arm/environment-setup

Use qmake2 to build software for the target
$ qmake2

Creating and building a simple example. We will create a simple Qt Embedded application and use qmake2 and make to cross compile.

$ . /usr/local/angstrom/arm/environment-setup
$ cd $HOME
$ mkdir qte-example
$ cd qte-example

$ echo "TEMPLATE=app
SOURCES=main.cpp
" > qte-example.pro

$ echo '#include <QApplication>
#include <QPushButton>

int main(int argc, char** argv) {
    QApplication app(argc, argv);

    QPushButton btn("Hello World");
    btn.show();
    btn.showMaximized();

    return app.exec();
}
' > main.cpp

$ qmake2
$ make

Copyright © 2006, 2007, 2008, 2009 Holger Hans Peter Freyther, Koen Kooi, Detlef Vollmann, Jamie Lenehan, Marcin Juszkiewicz, Rolf Leggewie

This document is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.