Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Installing Qt and running demos in Maemo 5 SDK

From Wiki
Jump to: navigation, search
Article Metadata
Created: marcelobarrosalmeida (18 Oct 2009)
Last edited: hamishwillee (29 Jun 2012)
Featured Article
06 Dec

Almost all Qt demos found in normal Qt installation can be used in Maemo. Since the default window style for Qt applications compiled for Maemo is Hildon, your application will follow Hildon style. It is possible to see larger menus, toolbars at bottom of screen, large close (x) button at upper right and so on. in this page it is possible to verify the current status of Qt Hildon widgets. In this article it is described how to install Qt for Maemo SDK 5 and running original Qt demos.

Adding Qt packages to Maemo 5 SDK

If you have already installed Maemo 5 SDK (see Maemo 5 SDK installation for beginners) and want to play with Qt, your next step is to install Qt libraries. Maemo community has a large tutorial about this subject, please check this link. There are pre-compiled binaries available for Debian/Ubuntu in the repository Maemo extras. Just login into scratchbox, add the repositories and install Qt packages.

sb-conf se FREMANTLE_X86
echo "deb fremantle free non-free" >> /etc/apt/sources.list
echo "deb fremantle free non-free" >> /etc/apt/sources.list
apt-get update
fakeroot apt-get install libqt4-gui libqt4-dev

The following packages will be installed:

libqt4-assistant libqt4-core libqt4-dbus libqt4-designer libqt4-help libqt4-network 
libqt4-sql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-script

It is interesting to add packages for phonon, sqlite and opengl, required in some Qt examples:

fakeroot apt-get install libqt4-phonon libqt4-opengl libqt4-opengl-dev libqt4-sql-sqlite

If you have any network problem during the installation, please check the following issues:

  • DNS problems: from a normal Linux shell check if /scratchbox/etc/resolv.conf is properly configured (it is supposed that your scratchbox is installed inside /scratchbox/). If it is wrong, you can copy your Linux resolve.conf using the following command:
cat /etc/resolv.conf | sudo tee /scratchbox/etc/resolv.conf
  • Proxy problems: if you are using proxies, it is necessary to configure it for proper APT operation. After logging into scratchbox you can create a file called 99proxy inside /etc/apt/apt.conf.d with the following contents:
Acquire::http::Proxy "http://proxy_user:user_passwd@proxy_address:proxy_port";

Just replace proxy_user, user_passwd, proxy_address and proxy_port by your own proxy settings.

Running Qt demos

For running these demos, start copying original Qt demos from your local Qt installation. For instance, suppose Qt is installed in /opt/qtsdk-2009.04/, you will find the demos at /opt/qtsdk-2009.04/qt/demos/. Besides, your home account inside scratchbox is located at /scratchbox/users/$USER/$HOME/ where $USER and $HOME are environment variables for current logged user name and its home directory. This way, the following command will copy all demos into scratchbox:

cp -a /opt/qtsdk-2009.04/qt/demos/ /scratchbox/users/$USER/$HOME/

Now you can login into scratchbox and compile your demo. For instance, suppose you want to run the textedit demo, do the following:

sb-conf se FREMANTLE_X86
cd ~/demos/textedit/

Using a Linux terminal, start Xephyr using DISPLAY 2:

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb &

Finally, execute textview demo in scratchbox:

export DISPLAY=:2 start ./textedit

In the next screenshots it is possible to see textedit in action.

Mba-qtdemo-textedit1.png Mba-qtdemo-textedit2.png

browser is other interesting demo based on webkit that can be executed in Maemo without modifications.

cd ~/demos/browser/
make ./browser

Mba-qtdemo-browser1.png Mba-qtdemo-browser2.png Mba-qtdemo-browser3.png

This page was last modified on 29 June 2012, at 01:34.
134 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.