<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=136.176.106.94</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=136.176.106.94"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/136.176.106.94"/>
	<updated>2026-04-21T23:21:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Qt4_development&amp;diff=34511</id>
		<title>Qt4 development</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Qt4_development&amp;diff=34511"/>
		<updated>2010-11-03T23:39:32Z</updated>

		<summary type="html">&lt;p&gt;136.176.106.94: /* How to compile a Qt application in Scratchbox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;IMPORTANT: This page is for Fremantle PR 1.2 using Qt 4.6 or higher.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;If you want to develop for Diablo or use Qt 4.5 please have a look at the [[Qt4_Hildon_Legacy|Qt4 Hildon Legacy Page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To develop with [[Qt-Maemo|Qt for Maemo]], a working SDK installation is required. There are [[Documentation/Maemo_5_Final_SDK_Installation|instructions on how to install the Maemo SDK]], and you can [http://www.youtube.com/watch?v=c8myh_iBy8k watch the Maemo SDK in action]. Alternatively, you may want to try [[MADDE]], a cross-platform Maemo development tool, available as a technology preview.&lt;br /&gt;
&lt;br /&gt;
Maemo 5 has [http://doc.qt.nokia.com/qt-maemo-4.6/index.html official Qt documentation] - especially see [http://doc.qt.nokia.com/qt-maemo-4.6/examples-maemo5.html the Maemo5 Qt examples page].&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
To start to develop with Maemo Qt, we need to [[Documentation/Maemo_5_Final_SDK_Installation|install the Maemo SDK]].&lt;br /&gt;
&lt;br /&gt;
Qt is available in public Fremantle repository since the release of [[Maemo 5/PR1.2|PR1.2]]. To upgrade older Scratchbox targets to use the latest packages, execute the following commands (inside Scratchbox):&lt;br /&gt;
 fakeroot apt-get update&lt;br /&gt;
 fakeroot apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
You can install Qt with the command:&lt;br /&gt;
 fakeroot apt-get install libqt4-dev&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GIANT WARNING&#039;&#039;&#039;: Your device might not be running Qt 4.6, but your Scratchbox probably is.  Make sure that your N900 has at least the PR1.2 update by checking the software version (found in Settings-&amp;gt;About product. PR1.2 is version 10.2010.19-1).&lt;br /&gt;
&lt;br /&gt;
===How to compile a Qt application in Scratchbox===&lt;br /&gt;
&lt;br /&gt;
Qt applications are usually built using QMake. Some projects, like KDE, use CMake, for more flexibility.&lt;br /&gt;
 &lt;br /&gt;
==== QMake ====&lt;br /&gt;
[http://doc.trolltech.com/qt-maemo-4.6/qmake-manual.html QMake] is a tool that helps simplify the build process for development project across different platforms&lt;br /&gt;
&lt;br /&gt;
You can build your Maemo Qt application in 3 simple steps:&lt;br /&gt;
# Generating project file (Required if there is no .pro file into the app source tree)&amp;lt;pre&amp;gt;qmake -project&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Generating Makefile from the QMake project file:&amp;lt;pre&amp;gt;qmake file.pro&amp;lt;/pre&amp;gt;&lt;br /&gt;
# &amp;lt;pre&amp;gt;make&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== CMake ====&lt;br /&gt;
&lt;br /&gt;
CMake projects usually have a &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; file instead of: &lt;br /&gt;
# .pro file used by QMake projects&lt;br /&gt;
# &amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt; used by Autotools projects (standard in Unix/Linux)&lt;br /&gt;
&lt;br /&gt;
Using CMake to build the project is extremely easy. In the directory containing &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, supply the following two commands, where path is the path to the source code.&lt;br /&gt;
 cmake path&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
Note: CMake is not installed by default in [[:Category:Scratchbox|Scratchbox]]. You can install it with the command:&lt;br /&gt;
 fakeroot apt-get install cmake&lt;br /&gt;
&lt;br /&gt;
=== Running a Qt application in: ===&lt;br /&gt;
==== Scratchbox ====&lt;br /&gt;
Diablo and Fremantle Qt applications can run on the device as in Scratchbox.&lt;br /&gt;
&lt;br /&gt;
First step to run a Qt application is starting the SDK UI:&lt;br /&gt;
 &lt;br /&gt;
# Run Xephyr on your host (not in Xephyr!). It is able to run a [[:wikipedia:X_Window_System|X Server]] inside another X Server.&amp;lt;pre&amp;gt;Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Inside Scratchbox, set the display for applications:&amp;lt;pre&amp;gt;export DISPLAY=:2&amp;lt;/pre&amp;gt;&lt;br /&gt;
# You can now run the SDK UI. A Diablo or Fremantle desktop will appear in your Xephyr window:&amp;lt;pre&amp;gt;af-sb-init.sh start&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now you are ready to run any Maemo or Maemo Qt application with:&amp;lt;pre&amp;gt;run-standalone.sh ./qtapps&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;run-standalone.sh&amp;lt;/code&amp;gt; sets some variable needed by Qt to use the Hildon style.&lt;br /&gt;
&lt;br /&gt;
Hint: If you don&#039;t want to run run-standalone.sh all the time, you can also source it: &amp;lt;pre&amp;gt;source /usr/bin/run-standalone.sh&amp;lt;/pre&amp;gt; In that shell, you can then run Qt applications without calling run-standalone.sh on every start.&lt;br /&gt;
&lt;br /&gt;
==== Device ====&lt;br /&gt;
Maemo Qt applications are Linux binaries. They can run on the device without any problem if you copy them to &amp;quot;partitions&amp;quot; mounted with exec flag. (for example, &amp;lt;code&amp;gt;/home/user&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/opt&amp;lt;/code&amp;gt; in Fremantle).&lt;br /&gt;
&lt;br /&gt;
For example, if we want to run quassel (Qt IRC Client), we have to launch it with:&lt;br /&gt;
 su -c ./quassel user&lt;br /&gt;
&lt;br /&gt;
== Porting Qt applications to Maemo ==&lt;br /&gt;
&lt;br /&gt;
Porting a Qt desktop application to Maemo requires very little effort. This is because the Maemo Qt libraries will take care of giving the Hildon look &amp;amp; Feel and enabling the virtual input methods for your application.&lt;br /&gt;
&lt;br /&gt;
===Overriding the Qt Maemo changes===&lt;br /&gt;
&lt;br /&gt;
====Maemo Style====&lt;br /&gt;
&lt;br /&gt;
Hildon Style is the default Qt application style. Other style available are:&lt;br /&gt;
* [http://doc.trolltech.com/qt-maemo-4.6/gallery-cleanlooks.html QCleanLooks]&lt;br /&gt;
* [http://doc.trolltech.com/qt-maemo-4.6/gallery-windows.html Windows]&lt;br /&gt;
* [http://doc.trolltech.com/qt-maemo-4.6/gallery-plastique.html Plastique]&lt;br /&gt;
&lt;br /&gt;
Qt application can use other Qt styles;&lt;br /&gt;
* Running your application with the style flag:&amp;lt;pre&amp;gt;./qt-test-application -style windows&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Using [http://doc.trolltech.com/qt-maemo-4.6/qapplication.html#setStyle QApplication::setStyle( QStyle * style )]&lt;br /&gt;
* If you want to change the style of a widget: [http://doc.trolltech.com/qt-maemo-4.6/qwidget.html#setStyle QWidget::setStyle( QStyle * style )]&lt;br /&gt;
&lt;br /&gt;
====Showing the status bar====&lt;br /&gt;
&lt;br /&gt;
Hildon applications don&#039;t have a status bar. Qt for Maemo hides the status bar by default.&lt;br /&gt;
&lt;br /&gt;
You can show it again by using method &amp;lt;code&amp;gt;statusBar()-&amp;gt;show()&amp;lt;/code&amp;gt; in your class derived from &amp;lt;code&amp;gt;QMainWindow&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding Maemo changes to a Qt Application===&lt;br /&gt;
&lt;br /&gt;
Some methods of Qt for Maemo are not available in the &amp;quot;standard&amp;quot; Qt libs, so a Qt application with specific Maemo Qt code can&#039;t be built outside the Maemo SDK. To avoid this issue, the developer can use the preprocessor directives:&lt;br /&gt;
&lt;br /&gt;
In the source code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#ifdef Q_WS_MAEMO_5&lt;br /&gt;
   //specific hildon/maemo5 code here&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the project file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
maemo5 {&lt;br /&gt;
   message(&amp;quot;Hello Hildon&amp;quot;)&lt;br /&gt;
   SOURCE += hildon.cpp&lt;br /&gt;
   HEADER += hildon.h&lt;br /&gt;
   FORMS   += hildon.ui&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Home widget interaction ===&lt;br /&gt;
&lt;br /&gt;
{{main|Qt4 and Hildon home widget interaction}}&lt;br /&gt;
&lt;br /&gt;
== Debugging a Qt application ==&lt;br /&gt;
&lt;br /&gt;
{{main|Documentation/Maemo_5_Developer_Guide/Kernel_and_Debugging_Guide/Maemo_Debugging_Guide}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Fremantle Gdb 6.8 crashes in x86 and gives messed up backtraces on the device. Using gdb 7.0 is recommended. You can get gdb 7.0 sources from http://ftp.de.debian.org/debian/pool/main/g/gdb/gdb_7.0.orig.tar.gz, compile it (./configure &amp;amp;&amp;amp; make) inside X86 and armel scratchbox targets.&lt;br /&gt;
[http://chaos.troll.no/~harald/gdb7/ Here you can find GDB7 for fremantle x86 and armel]. &lt;br /&gt;
 /usr/local/bin/gdb7 ./myapp&lt;br /&gt;
&lt;br /&gt;
== Profiling a Qt application ==&lt;br /&gt;
&lt;br /&gt;
=== OProfile ===&lt;br /&gt;
&lt;br /&gt;
{{main|Documentation/devtools/maemo5/oprofile}}&lt;br /&gt;
&lt;br /&gt;
=== Valgrind ===&lt;br /&gt;
&lt;br /&gt;
{{main|Documentation/devtools/maemo5/valgrind}}&lt;br /&gt;
&lt;br /&gt;
== Packaging a Qt application for Maemo ==&lt;br /&gt;
&lt;br /&gt;
{{main|Packaging a Qt application}}&lt;br /&gt;
&lt;br /&gt;
== Maemo Qt API Reference ==&lt;br /&gt;
&lt;br /&gt;
Maemo Qt is based on Qt for X11. It shares same APIs avoiding API breaks. In this way every Qt application that runs in other platforms (Windows, Mac OS X, Linux, S60, etc.) can run in Maemo devices as well. To Develop a Qt application you can use the [http://qt.nokia.com/doc/qt-maemo-4.6 Official Qt 4.6 for Maemo API documentation] and the list below to see what are the Maemo changes.&lt;br /&gt;
&lt;br /&gt;
Here are examples that show several Maemo 5 Qt widgets in Qt.&lt;br /&gt;
&lt;br /&gt;
* http://qt.nokia.com/doc/qt-maemo-4.6/examples-maemo5.html&lt;br /&gt;
* http://qt.gitorious.org/+qt-developers/qt/x11-maemo/trees/4.6-fremantle/examples/maemo5/widgets&lt;br /&gt;
&lt;br /&gt;
===Maemo5 Readme file===&lt;br /&gt;
&lt;br /&gt;
There is a [http://qt.gitorious.org/+qt-developers/qt/x11-maemo/blobs/4.6-fremantle/README.maemo5 README file in Qt source tree].&lt;br /&gt;
&lt;br /&gt;
== Contributing to the Maemo Qt Project ==&lt;br /&gt;
&lt;br /&gt;
Maemo Qt is a community project. Contributing to the forum, sending us patches, give us feedbacks, tracking bugs are all activities that help us to improve the quality of our work.&lt;br /&gt;
&lt;br /&gt;
Here there is a list of things that every person interested in helping us should read.&lt;br /&gt;
&lt;br /&gt;
===Stay updated===&lt;br /&gt;
&lt;br /&gt;
Any Maemo Qt developer should be updated and should participate to the discussions, for that he must join the Mailing list. BTW the mailing list is not for Maemo Qt Developers but it&#039;s open to Maemo Qt application developers too.&lt;br /&gt;
&lt;br /&gt;
=== Introduction to Git ===&lt;br /&gt;
&lt;br /&gt;
If you are a git newbie you maybe find interesting these links:&lt;br /&gt;
* http://www.sourcemage.org/Git_Guide&lt;br /&gt;
* http://www.gitcasts.com/&lt;br /&gt;
* http://www.gnome.org/~newren/eg/git-for-svn-users.html&lt;br /&gt;
* Using the git protocol through a HTTP CONNECT proxy: http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/&lt;br /&gt;
&lt;br /&gt;
===Understanding the structure of our Git repository===&lt;br /&gt;
&lt;br /&gt;
{{main|Qt Maemo Git Process}}&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
&lt;br /&gt;
Make sure each scratchbox target has&lt;br /&gt;
&lt;br /&gt;
  fakeroot apt-get build-dep libqt4-gui&lt;br /&gt;
&lt;br /&gt;
(you may need to apt-get install libgl-dev too as it&#039;s not in the Build-Depends: yet)&lt;br /&gt;
&lt;br /&gt;
===Building Qt from Git repository===&lt;br /&gt;
&lt;br /&gt;
# Clone the repository:&amp;lt;br/&amp;gt;&amp;lt;pre&amp;gt;git clone git://gitorious.org/+qt-developers/qt/x11-maemo.git qt-maemo&amp;lt;/pre&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
# Change dir:&amp;lt;br/&amp;gt;&amp;lt;pre&amp;gt;cd qt-maemo&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Configure Qt:&amp;lt;br/&amp;gt;&amp;lt;pre&amp;gt;./configure -maemo5&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Build Qt:&amp;lt;br/&amp;gt;&amp;lt;pre&amp;gt;make&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Install Qt:&amp;lt;br/&amp;gt;&amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Merging branches changes in the mainline [OLD]===&lt;br /&gt;
&lt;br /&gt;
Before to merge your changes in the mainline, the code must be full working, cleaned and tested. A review from another developer is also needed in order to reduce the possibility to add errors.&lt;br /&gt;
&lt;br /&gt;
===QML===&lt;br /&gt;
&lt;br /&gt;
[[QML]] is a GUI interface building scripting language for Qt. Check out the [[QML-EnhancedCalcExample | QML calculator example]].&lt;br /&gt;
&lt;br /&gt;
==F.A.Q.==&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;I&#039;m trying to compile a Qt application for ARMEL, but I got the error below. What&#039;s wrong?&#039;&#039;&lt;br /&gt;
: &amp;lt;pre&amp;gt;/targets/FREMANTLE_X86/usr/include/qt4/QtCore/qatomic_i386.h:127: error: impossible constraint in &#039;asm&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:You are using x86 include files, then you have to update your Makefile. Running &amp;lt;code&amp;gt;qmake&amp;lt;/code&amp;gt; before &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; will be solve this issue.&lt;br /&gt;
&lt;br /&gt;
; I&#039;m trying to compile a Qt packcage for x86, but I got the error below. What&#039;s wrong?&lt;br /&gt;
: &amp;lt;pre&amp;gt;In file included from maemo/gconfsymbols.cpp:41:&lt;br /&gt;
 maemo/gconfsymbols_p.h:49:25: gconf/gconf.h: No such file or directory&amp;lt;/pre&amp;gt;&lt;br /&gt;
: Your scratchbox does not have &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt;, so when calling &amp;lt;code&amp;gt;pkg-config&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;qmake&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CFLAGS&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;LIBS&amp;lt;/code&amp;gt; are not set correctly. Running &amp;lt;code&amp;gt;ln -s /scratchbox/tools/bin/sh /bin/sh&amp;lt;/code&amp;gt; will be solve this issue.&lt;br /&gt;
&lt;br /&gt;
; I installed Qt (libqt4-dev) to scratchbox and tried to build a sample application, but I got the error because some header files such as qhildonstyle.h, and qvfbhdr.h etc. were missing&lt;br /&gt;
: libqt4-dev should copy all header files, but now, at least in 4.5.2-1maemo1, some files are missing. Please download file below and extract to your scratchbox system.&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://qt4.garage.maemo.org/patches/qt4-missing-header.tgz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Qt]]&lt;/div&gt;</summary>
		<author><name>136.176.106.94</name></author>
	</entry>
</feed>