Developing with C++ and Qt

From Openmoko

NOTE: This article is way to unify community experience, tips and tricks in order to develop C++ applications based on the QT framework. It's actually incomplete and may be wrong in several parts, please fix and improve!

Contents

Introduction

extracted from wikipedia:

Qt is a cross-platform application development framework, widely used for the development of GUI programs, and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in KDE, Opera, Google Earth, Skype, Qtopia, Photoshop Elements, VirtualBox and OPIE. It is produced by the Norwegian company Trolltech and developed at its Brisbane office in Australia. Nokia acquired Trolltech on January 28, 2008.

Applications using Qt should run on 2008.x, FSO/SHR, and Qtopia from Trolltech (on this firmware alternative widget toolkits, as gtk+, actually do not work, as they need an X server). This make Qt a good choice to start developing new applications for the Openmoko world.

Developing with Trolltech/Qtopia

The SDK for the new version 4.4.1 of Qtopia, formerly called QTExtended is not ready yet, tarball is available but it lacks updated documentation.

Use pre-built SDK

Trolltech provides good SDK and documentation. You can download the official SDK here.

It's a VMware based virtual machine you can run with the free vmplayer. This is a ready to go solution. What you get is an .iso image. Mount the iso. There's a readme in there.
You will need to execute a script install.sh, which will generate several .vmdk files. Afterwards you need to load these into your vmplayer.

The VM is Ubuntu, and comes with a Qtopia SDK (surprise, surprise). Use krandrtray to switch to correct screen resolution. I had to install a new version of VMware to get this running, but unsure if this is really necessary. For the VMware stuff, you might need to have the kernel headers. Remember that Ubuntu calls them linux-headers. Also remember this is Ubuntu, for root access just sudo command.

now you have to comment the line:
PREFERRED_VERSION_qt4-x11-free ?= "4.3.3"
in the file
openembedded/conf/distro/include/preferred-om-2008-versions.inc
This is necessary to build qt 4.4.1 and to fix a problem in the oetree.
FIXME, is it possible to use a local .conf file to set a correct preferred version, but how unset it definitively?

You are now ready to build Qt by typing:
. setup-env
bitbake qt4-x11-free

After that you'll have staging Qt arm libraries and x86 tools to build your application, so you'll have to create a somename.bb file.

Views

Personal tools

NOTE: This article is way to unify community experience, tips and tricks in order to develop C++ applications based on the QT framework. It's actually incomplete and may be wrong in several parts, please fix and improve!

Introduction

extracted from wikipedia:

Qt is a cross-platform application development framework, widely used for the development of GUI programs, and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in KDE, Opera, Google Earth, Skype, Qtopia, Photoshop Elements, VirtualBox and OPIE. It is produced by the Norwegian company Trolltech and developed at its Brisbane office in Australia. Nokia acquired Trolltech on January 28, 2008.

Applications using Qt should run on 2008.x, FSO/SHR, and Qtopia from Trolltech (on this firmware alternative widget toolkits, as gtk+, actually do not work, as they need an X server). This make Qt a good choice to start developing new applications for the Openmoko world.

Developing with Trolltech/Qtopia

The SDK for the new version 4.4.1 of Qtopia, formerly called QTExtended is not ready yet, tarball is available but it lacks updated documentation.

Use pre-built SDK

Trolltech provides good SDK and documentation. You can download the official SDK here.

It's a VMware based virtual machine you can run with the free vmplayer. This is a ready to go solution. What you get is an .iso image. Mount the iso. There's a readme in there.
You will need to execute a script install.sh, which will generate several .vmdk files. Afterwards you need to load these into your vmplayer.

The VM is Ubuntu, and comes with a Qtopia SDK (surprise, surprise). Use krandrtray to switch to correct screen resolution. I had to install a new version of VMware to get this running, but unsure if this is really necessary. For the VMware stuff, you might need to have the kernel headers. Remember that Ubuntu calls them linux-headers. Also remember this is Ubuntu, for root access just sudo command.

now you have to comment the line:
PREFERRED_VERSION_qt4-x11-free ?= "4.3.3"
in the file
openembedded/conf/distro/include/preferred-om-2008-versions.inc
This is necessary to build qt 4.4.1 and to fix a problem in the oetree.
FIXME, is it possible to use a local .conf file to set a correct preferred version, but how unset it definitively?

You are now ready to build Qt by typing:
. setup-env
bitbake qt4-x11-free

After that you'll have staging Qt arm libraries and x86 tools to build your application, so you'll have to create a somename.bb file.