embedding qt

Download Embedding Qt

If you can't read please download the document

Post on 16-Apr-2017

2.817 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

Embedding Qt

A workshop in running Qton embedded Linux targets

Johan Thelin

Books, articles, whitepapers, tutorials

Training (embedded Linux, etc)

Various embedded Qt-based products

Qt mentoring

Networking (human to human)

Founder and moderator at QtCentre

Looking for Qt jobs related to Formula 1!

Two minutes of Qt

Developed since 1991

Licensing controversy 1998

GPL since 2005 (X11 2000, OS X 2003)

LGPL on all platforms since 2008

Trolltech was bought by Nokia 2008, renamed to Qt Software Qt Development Frameworks.

We call them Qt, and the developers are trolls.

Two minutes of Qt

Desktop: Windows, OS X and X11

Goal: native applications from one sourceGLIB integration

Styling, etc

Embedded: Windows CE, Symbian S60, Linux

100+ million devices out there!

The Qt Community

An open development model

Developer blogs: labs.trolltech.com

planetqt.org

Forums, wikis, IRC channels:qtcentre.org forum, wiki, news

qtnode.net #qt on freenode, wiki

Much more...

Workshop

Compiling compiling compiling compiling

Compiling

Compiling compiling compiling

Compiling compiling compiling compiling

Compiling compiling compiling

Compiling compiling

Compiling compiling compiling

Compiling compiling compiling compiling

Compiling compiling compiling

Workshop

Background a common development setup

Getting the source

Configuring and building for X11

Working with multiple installs of Qt and QMake

Configuring and building for QVFb

Embedded Linux 101

Configuring Qt for Embedded Linux

Deploying Qt on an embedded Linux target

Testing the Development Setup

The Development Setup

The setup consists of three installations of QtQt for X11 runs on host, used for tools.

Qt for QVFb runs on host with emulated devices

Qt for target runs on target, the real deal.

QVFb Qt Virtual Framebuffer lets youPrototype

Emulate for simplified debugging

Great for screenshots for manuals and designers

Getting the Sources

Sources are found at qt.nokia.com/downloads

Getting the Sources

Or you grab a snapshot from qt.gitorious.org

Getting the Sources

I have a USB stick with tar.gz-archives for today

Use Embedding\ Qt/*

$ ./configure --helpUsage: configure [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir ] [-docdir ] [-headerdir ] [-plugindir ] [-datadir ] [-translationdir ] [-sysconfdir ] [-examplesdir ] [-demosdir ] [-buildkey ] [-release] [-debug] [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile] [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility] [-accessibility] [-no-stl] [-stl] [-no-sql-] [-sql-] [-plugin-sql-] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D ] [-I ] [-L ] [-help] [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make ] [-no-make ] [-R ] [-l ] [-no-rpath] [-rpath] [-continue] [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-qtnamespace ] [-qtlibinfix ] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-openssl] [-openssl] [-openssl-linked] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-scripttools] [-scripttools]

[additional platform specific options (see below)]

Configuring Qt for X11

And then there are the undocumented switches...

$ ./configure --helpUsage: configure [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir ] [-docdir ] [-headerdir ] [-plugindir ] [-datadir ] [-translationdir ] [-sysconfdir ] [-examplesdir ] [-demosdir ] [-buildkey ] [-release] [-debug] [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile] [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility] [-accessibility] [-no-stl] [-stl] [-no-sql-] [-sql-] [-plugin-sql-] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D ] [-I ] [-L ] [-help] [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make ] [-no-make ] [-R ] [-l ] [-no-rpath] [-rpath] [-continue] [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-qtnamespace ] [-qtlibinfix ] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-openssl] [-openssl] [-openssl-linked] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-scripttools] [-scripttools]

[additional platform specific options (see below)]

Configuring Qt for X11

-prefix path -no-qt3support -nomake demos -nomake examples

Which edition of Qt do you want to use ?

Type 'c' if you want to use the Commercial Edition.Type 'o' if you want to use the Open Source Edition.

o

This is the Qt/X11 Open Source Edition.

You are licensed to use this software under the terms ofthe Lesser GNU General Public License (LGPL) versions 2.1.You are also licensed to use this software under the terms ofthe GNU General Public License (GPL) versions 3.

Type '3' to view the GNU General Public License version 3.Type 'L' to view the Lesser GNU General Public License version 2.1.Type 'yes' to accept this license offer.Type 'no' to decline this license offer.

Do you accept the terms of either license?

yes

Creating qmake. Please wait...

Configuring Qt for X11

Let this run through, then run make.

Multiple Qt Installs and QMake

QMake builds Makefiles (and projects, etcetera)Build a project file: qmake -project

Build a Makefile from a project file: qmake

For this, QMake knows aboutThe compiler to use

Paths and libraries to use

QMake is built when configuring Qt, so each Qt installation has a different QMake.

Multiple Qt Installs and QMake

project.procpphuiqrcqmake-x11qmake-targetqmake-qvfbMakefile+

Executable

Change qmake:

make distclean && qmake-nn

Building the QVFb

The QVFb tool is not built automatically when building Qt for X11.

cd tools/qvfbmakemake install

Configuring Qt for QVFb

Problem: The sources are extracted to qt-embedded-... . This is the same directory as will be used by the target sources.

Solution: Rename to qt-qvfb!

Configuring Qt for QVFb

$ ./configure --helpUsage: ...

[additional platform specific options (see below)]

...

Qt for Embedded Linux only:

-xplatform target ... The target platform when cross-compiling.

-no-feature- Do not compile in . -feature- .. Compile in . The available features are described in src/corelib/global/qfeatures.txt

-embedded .... This will enable the embedded build, you must have a proper license for this switch to work. Example values for : arm mips x86 generic

-armfpa ............. Target platform is uses the ARM-FPA floating point format. -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.

The floating point format is usually autodetected by configure. Use this to override the detected value.

-little-endian ...... Target platform is little endian (LSB first). -big-endian ......... Target platform is big endian (MSB first).

-host-little-endian . Host platform is little endian (LSB first). -host-big-endian .... Host platform is big endian (MSB first).

You only need to specify the endianness when cross-compiling, otherwise the host endianness will be used.

-no-freetype ........ Do not compile in Freetype2 support. -qt-freetype ........ Use the libfreetype bundled with Qt. * -system-freetype .... Use libfreetype from the operating system. See http://www.freetype.org/

-qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the default (full).

-depths ...... Comma-separated list of supported bit-per-pixel depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.

-qt-decoration- ....Enable a decoration in the QtGui library, by default all available decorations are on. Possible values for : [ styled windows default ] -plugin-decoration- Enable decoration as a plugin to be linked to at run time. Possible values for : [ default styled windows ] -no-decoration- ....Disable decoration entirely. Possible values for : [ styled windows default ]

-no-opengl .......... Do not support OpenGL. -opengl ....... Enable OpenGL ES support With no parameter, this will attempt to auto-detect OpenGL ES 1.x or 2.x. Use es1, es1cl or es2 for to override auto-detection.

NOTE: A QGLScreen driver for the hardware is required to support OpenGL ES on Qt for Embedded Linux.

-qt-gfx-