<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanRog</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanRog"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/DanRog"/>
	<updated>2026-04-16T12:35:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21719</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21719"/>
		<updated>2012-03-10T09:41:15Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How to cross-compile Qt for WebOS =&lt;br /&gt;
History:&lt;br /&gt;
&lt;br /&gt;
* 08.02.2012: first version&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# '''make'''&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugin into ~/qte-48/plugins/gfxdrivers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5. Limitations ==&lt;br /&gt;
&lt;br /&gt;
* No virtual keyboard so far&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;br /&gt;
&lt;br /&gt;
[3] A-Browser QML [http://danielroggen.net/sw/abrowse-qml.zip source] and [http://www.webosnation.com/a-browser-qml-test binary]&lt;br /&gt;
&lt;br /&gt;
[4] A-Browser Qt [http://danielroggen.net/sw/abrowse-qt.zip source] and [http://www.webosnation.com/a-browser-qt-test binary]&lt;br /&gt;
&lt;br /&gt;
[5] Updated [http://code.google.com/p/qt-webos/ WebOS gfxdrivers plugin]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21649</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21649"/>
		<updated>2012-02-08T15:16:45Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;History:&lt;br /&gt;
&lt;br /&gt;
* 08.02.2012: first version&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# '''make'''&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugin into ~/qte-48/plugins/gfxdrivers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5. Limitations ==&lt;br /&gt;
&lt;br /&gt;
* No virtual keyboard so far&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;br /&gt;
&lt;br /&gt;
[3] A-Browser QML [http://danielroggen.net/sw/abrowse-qml.zip source] and [http://www.webosnation.com/a-browser-qml-test binary]&lt;br /&gt;
&lt;br /&gt;
[4] A-Browser Qt [http://danielroggen.net/sw/abrowse-qt.zip source] and [http://www.webosnation.com/a-browser-qt-test binary]&lt;br /&gt;
&lt;br /&gt;
[5] Updated [http://code.google.com/p/qt-webos/ WebOS gfxdrivers plugin]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21647</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21647"/>
		<updated>2012-02-08T15:15:36Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# '''make'''&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugin into ~/qte-48/plugins/gfxdrivers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5. Limitations ==&lt;br /&gt;
&lt;br /&gt;
* No virtual keyboard so far&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;br /&gt;
&lt;br /&gt;
[3] A-Browser QML [http://danielroggen.net/sw/abrowse-qml.zip source] and [http://www.webosnation.com/a-browser-qml-test binary]&lt;br /&gt;
&lt;br /&gt;
[4] A-Browser Qt [http://danielroggen.net/sw/abrowse-qt.zip source] and [http://www.webosnation.com/a-browser-qt-test binary]&lt;br /&gt;
&lt;br /&gt;
[5] Updated [http://code.google.com/p/qt-webos/ WebOS gfxdrivers plugin]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21645</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21645"/>
		<updated>2012-02-08T15:12:42Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 3.4 Cross-compile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# '''make'''&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugin into ~/qte-48/plugins/gfxdrivers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21643</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21643"/>
		<updated>2012-02-08T15:12:15Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 3.4 Cross-compile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugin into ~/qte-48/plugins/gfxdrivers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21641</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21641"/>
		<updated>2012-02-08T15:11:42Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* Compilation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugint to ~/qte-48/&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21639</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21639"/>
		<updated>2012-02-08T15:11:09Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 3.4 Cross-compile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
The WebOS gfxdrivers plugin must be compiled manually:&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/webos'''&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
This builds and copies the plugint to ~/qte-48/&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21637</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21637"/>
		<updated>2012-02-08T15:09:58Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution.  &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML files. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
The binaries are available on the WebOS homebrew app repository [www.webosnation.com/a-browser-qt-test here] and [www.webosnation.com/a-browser-qml-test here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
We can now test the application, and create an IPK which can be uploaded to the HP or homebrew app repository.&lt;br /&gt;
&lt;br /&gt;
In order to test the app, it must be copied to the device together with Qt libs. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a STAGING directory which contains:&lt;br /&gt;
* the application&lt;br /&gt;
* the Qt stuff (keeping the directory structure mentionned above)&lt;br /&gt;
* the icon&lt;br /&gt;
* the appinfo.json&lt;br /&gt;
* any other required file&lt;br /&gt;
&lt;br /&gt;
And run '''palm-package STAGING'''. This will create an .ipk ready for distribution. Before distributing, try to install it on the device with Preware: copy the ipk to the device, run Preware and select the option to install ipk packages from the menu, and check that your app works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21635</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21635"/>
		<updated>2012-02-08T15:03:26Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qt.zip abrowse-qt here]&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser. Since this is a QML app, a QmlApplicationViewer must be used to run the QML. Download the source with the modifications [http://danielroggen.net/sw/abrowse-qml.zip here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Deployment ===&lt;br /&gt;
&lt;br /&gt;
The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can typically deploy these files in /media/internal/APPDIR for testing and run the application from the command line.&lt;br /&gt;
&lt;br /&gt;
To create an IPK file you need in addition an appinfo.json file. For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;title&amp;quot;: &amp;quot;A-Browser Qml (test)&amp;quot;,&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;pdk&amp;quot;,&lt;br /&gt;
	&amp;quot;main&amp;quot;: &amp;quot;abrowse-qml&amp;quot;,&lt;br /&gt;
	&amp;quot;id&amp;quot;: &amp;quot;net.danielroggen.abrowseqml&amp;quot;,&lt;br /&gt;
        &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
	&amp;quot;vendor&amp;quot;: &amp;quot;danielroggen&amp;quot;,&lt;br /&gt;
	&amp;quot;icon&amp;quot;:     &amp;quot;icon.png&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21633</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21633"/>
		<updated>2012-02-08T14:51:07Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* Compilation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;qml path: %s\n&amp;quot;,qmlpath.toStdString().c_str());&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Same as for Qt-widget apps.&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21631</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21631"/>
		<updated>2012-02-08T14:36:28Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. See the deployment section below for how to lay-out the files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Demos/4.8/declarative/webbrowser in your working directory, e.g. ~/webbrowser&lt;br /&gt;
&lt;br /&gt;
Essentially the same modifications must be made to the Qt-QML project as for the Qt-widget project, with some additions to the main file.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
Same as for the Qt-widget app, and in addition we must set the path where the QML imports can be found. This can be specified with the QML_IMPORT_PATH environment variable. We set-it up programmatically here.&lt;br /&gt;
&lt;br /&gt;
The file main.cpp looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP    QML SETUP&lt;br /&gt;
    QString qmlpath = QString(pathexe)+&amp;quot;/imports&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;qml path: %s\n&amp;quot;,qmlpath.toStdString().c_str());&lt;br /&gt;
    if(!qputenv(&amp;quot;QML_IMPORT_PATH&amp;quot;,qmlpath.toAscii()))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set qml path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21629</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21629"/>
		<updated>2012-02-08T14:29:46Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
&lt;br /&gt;
Generate the makefile and compile:&lt;br /&gt;
# ~/qte-48/bin/qmake fancybrowser.pro&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Now the app is compiled. The Qt libs must also be deployed on the device. The device directory structure, assuming the app is in APPDIR, must be as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPDIR:                  the application is here&lt;br /&gt;
APPDIR/qt:               qt libs. Copy ~/qte-48/lib/*.so.4 here)&lt;br /&gt;
APPDIR/fonts:            fonts (not needed if the WebOS fonts are used). Copy ~/qte-48/lib/fonts/* here&lt;br /&gt;
APPDIR/gfxdrivers:       gfxdrivers plugins. Copy ~/qte-48/plugins/gfxdrivers/* here&lt;br /&gt;
APPDIR/imageformats:     imageformats plugins. Copy ~/qte-48/plugins/imageformats/* here&lt;br /&gt;
APPDIR/imports:          QML stuff (not needed for Qt-widget). Copy ~/qte-48/imports/* here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21627</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21627"/>
		<updated>2012-02-08T14:22:43Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* Modifications to the main file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS - business as usual&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21625</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21625"/>
		<updated>2012-02-08T14:22:10Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* Modifications to the main file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
There are modifications to main.cpp in three categories.&lt;br /&gt;
&lt;br /&gt;
When instanciating a QApplication object the fonts are search in the directory specified by the QT_QWS_FONTDIR environment variable. To my knowledge this cannot be specified to QApplication in another way. Therefore we set programmatically QT_QWS_FONTDIR to where we have our fonts. There are two possibilities: we can deploy the fonts of Qt, or we can use the fonts already available on the WebOS device. Using the fonts of the WebOS device is fine so we use this. See the commented-out line for the alternative approach.&lt;br /&gt;
&lt;br /&gt;
When instanciating the QApplication object we want to start the application as a GUI server application. This is achieved by passing QApplication::GuiServer in the QApplication constructor. The alternative approach is to call the program with '''-qws''' on the command line.&lt;br /&gt;
&lt;br /&gt;
The gfxdrivers plugin must be specified. This can be done with the '''-display''' command line argument. Here we programmatically set this command line argument.&lt;br /&gt;
We have two alternatives. We can use directly the WebOS gfxdrivers plugin. This does not allow for screen rotation. The command line would then be ''''-display PalmPreSDLFb:nnn'''. &lt;br /&gt;
Alternatively, we can use the transformed gfxdrivers in combination with the WebOS gfxdrivers plugin. This allows for screen rotation. The command line would then be '''-display Transformed:PalmPreSDLFb:nnn'''.&lt;br /&gt;
&lt;br /&gt;
'''nnn''' is a number which you must set to identify the display driver. In a normal embedded system only a single GUI server application would run at any time, and this number can be the same for all applications (or even left out, QApplication assumes number 0 then). This number is used by Qt to create a temporary directory ('''/tmp/qtembedded-nnn''') that contains, among others, a font cache.&lt;br /&gt;
&lt;br /&gt;
However, on WebOS each running Qt applications is a GUI server. Each application will thus create a '''/tmp/qtembedded-nnn''' directory. Therefore '''nnn''' must be unique for each Qt application. (maybe we need a convention to avoid conflicts - might be enough to use some randomly generated number for each app).&lt;br /&gt;
&lt;br /&gt;
main.cpp can be modified as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))              // USE THIS IF YOU DEPLOY YOUR OWN FONTS&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))                // USE THIS IF YOU USE THE WEBOS FONTS&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};              // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN W/O ROTATION&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:100&amp;quot;};    // USE THIS FOR THE WEBOS GFXDRIVERS PLUGIN AND ROTATION&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);  &lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS, all OK&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21623</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21623"/>
		<updated>2012-02-08T14:03:51Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* Modifications to the .pro file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '''!win32:{...}''' sets these parameters for any &amp;quot;non windows build&amp;quot; (I happen to build the desktop app on Windows and the WebOS app on Linux). Ideally we would rather have something for webos ('''webos:{...}''') but I did not investigate how to do enable that - if somebody knows, feel free to share.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
QApplication::GuiServer&lt;br /&gt;
&lt;br /&gt;
* The first thing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;font path: %s\n&amp;quot;,fontpath.toStdString().c_str());&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:1&amp;quot;};&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
    for(unsigned i=0;i&amp;lt;argc2;i++)&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;%d: %s\n&amp;quot;,i,argv2[i]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
    //QApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS, all OK&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QUrl url;&lt;br /&gt;
    if (argc &amp;gt; 1)&lt;br /&gt;
        url = QUrl(argv[1]);&lt;br /&gt;
    else&lt;br /&gt;
       //url = QUrl(&amp;quot;http://www.google.com/ncr&amp;quot;);&lt;br /&gt;
       url = QUrl(&amp;quot;http://www.slashdot.org&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    MainWindow *browser = new MainWindow(url);&lt;br /&gt;
&lt;br /&gt;
    #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR || defined Q_WS_QWS&lt;br /&gt;
        browser-&amp;gt;showMaximized();&lt;br /&gt;
    #else&lt;br /&gt;
        browser-&amp;gt;show();&lt;br /&gt;
    #endif&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
    const int width = 640;&lt;br /&gt;
       const int height = 480;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsScene scene;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsView view(&amp;amp;scene);&lt;br /&gt;
       view.setFrameShape(QFrame::NoFrame);&lt;br /&gt;
       view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
       view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
&lt;br /&gt;
       QGraphicsWebView webview;&lt;br /&gt;
       webview.resize(width, height);&lt;br /&gt;
       webview.load(QUrl(&amp;quot;http://www.slashdot.org&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
       scene.addItem(&amp;amp;webview);&lt;br /&gt;
&lt;br /&gt;
       view.resize(width, height);&lt;br /&gt;
       view.show();*/&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21621</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21621"/>
		<updated>2012-02-08T14:01:09Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because the same results can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which is a bit more complex but may seen as more clean.&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the .pro file ====&lt;br /&gt;
&lt;br /&gt;
The pro file must be modified to link the PDL and SDL libs, and also to look for the Qt libraries at the right location at runtime. Here we assume that the Qt libs are in a subdirectory called 'qt' below the directory where the application is deployed. &lt;br /&gt;
&lt;br /&gt;
Modify fancybrowser.pro and add this at the end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
!win32: {&lt;br /&gt;
message(assume qws)&lt;br /&gt;
# Set the runtime path to a relative directory w.r.t. the location of the executable&lt;br /&gt;
LIBS += -Wl,-rpath,&amp;quot;'\$$ORIGIN/qt'&amp;quot; -L/opt/PalmPDK/device/lib -lpdl -lSDL&lt;br /&gt;
INCLUDEPATH += /opt/PalmPDK/include/SDL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifications to the main file ====&lt;br /&gt;
&lt;br /&gt;
QApplication::GuiServer&lt;br /&gt;
&lt;br /&gt;
* The first thing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;font path: %s\n&amp;quot;,fontpath.toStdString().c_str());&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:1&amp;quot;};&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
    for(unsigned i=0;i&amp;lt;argc2;i++)&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;%d: %s\n&amp;quot;,i,argv2[i]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
    //QApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS, all OK&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QUrl url;&lt;br /&gt;
    if (argc &amp;gt; 1)&lt;br /&gt;
        url = QUrl(argv[1]);&lt;br /&gt;
    else&lt;br /&gt;
       //url = QUrl(&amp;quot;http://www.google.com/ncr&amp;quot;);&lt;br /&gt;
       url = QUrl(&amp;quot;http://www.slashdot.org&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    MainWindow *browser = new MainWindow(url);&lt;br /&gt;
&lt;br /&gt;
    #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR || defined Q_WS_QWS&lt;br /&gt;
        browser-&amp;gt;showMaximized();&lt;br /&gt;
    #else&lt;br /&gt;
        browser-&amp;gt;show();&lt;br /&gt;
    #endif&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
    const int width = 640;&lt;br /&gt;
       const int height = 480;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsScene scene;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsView view(&amp;amp;scene);&lt;br /&gt;
       view.setFrameShape(QFrame::NoFrame);&lt;br /&gt;
       view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
       view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
&lt;br /&gt;
       QGraphicsWebView webview;&lt;br /&gt;
       webview.resize(width, height);&lt;br /&gt;
       webview.load(QUrl(&amp;quot;http://www.slashdot.org&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
       scene.addItem(&amp;amp;webview);&lt;br /&gt;
&lt;br /&gt;
       view.resize(width, height);&lt;br /&gt;
       view.show();*/&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21619</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21619"/>
		<updated>2012-02-08T13:55:29Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
The way compilation of the apps is mostly identical, but the QML-based project has a few extra complexities so we'll see first the widget-based project.&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Qt-widget app ===&lt;br /&gt;
&lt;br /&gt;
We assume a copy of QTSDKDIR/Examples/4.8/webkit/fancybrowser in your working directory, e.g. ~/fancybrowser&lt;br /&gt;
&lt;br /&gt;
Two things must be modified in the project: &lt;br /&gt;
* fancybrowser.pro: this is the project file, it must be modified to include the proper libraries&lt;br /&gt;
* main.cpp: this is the file in which the QApplication object is instanciated. We must do some setup to indicate to the application:&lt;br /&gt;
** where to find system fonts, &lt;br /&gt;
** to start the application as a GUI server application&lt;br /&gt;
** to use the WebOS gfxdrivers plugin, or to use the transformed gfxdrivers plugin in combination with the WebOS gfxdrivers plugin to support screen rotation.&lt;br /&gt;
&lt;br /&gt;
Note that one could avoid modifying main.cpp altogether because these settings can be achieved by environment variables and by command line arguments. Therefore a script could set the environment variables and call the executable with the appropriate parameters. However we go through the self-contained solution, which may be a little bit more complex but is also more clean.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QApplication::GuiServer&lt;br /&gt;
&lt;br /&gt;
* The first thing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main(int argc, char * argv[])&lt;br /&gt;
{&lt;br /&gt;
    int rv;&lt;br /&gt;
&lt;br /&gt;
#ifdef Q_WS_QWS&lt;br /&gt;
#warning &amp;quot;Hacks for QWS&amp;quot;&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // Get the path to the exe...&lt;br /&gt;
    // Ideally we should use QApplication::applicationDirPath, but instanciating that&lt;br /&gt;
    // one attempts to load the fonts... which aren't defined yet&lt;br /&gt;
    char pathexe[1024];&lt;br /&gt;
    rv = readlink(&amp;quot;/proc/self/exe&amp;quot;, pathexe, sizeof(pathexe));&lt;br /&gt;
    if(!(rv&amp;gt;0 &amp;amp;&amp;amp; rv&amp;lt;sizeof(pathexe)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Couldn't get the exe path - terminating\n&amp;quot;);&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
    pathexe[rv]=0;&lt;br /&gt;
    printf(&amp;quot;path to exe: %s\n&amp;quot;,pathexe);&lt;br /&gt;
    *strrchr(pathexe,'/')=0;    // Eliminate the application name&lt;br /&gt;
    QString fontpath = QString(pathexe)+&amp;quot;/fonts&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;font path: %s\n&amp;quot;,fontpath.toStdString().c_str());&lt;br /&gt;
    //if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,fontpath.toAscii()))&lt;br /&gt;
    if(!qputenv(&amp;quot;QT_QWS_FONTDIR&amp;quot;,&amp;quot;/usr/share/fonts&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Can't set font path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    //&lt;br /&gt;
    // FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP    FONT SETUP&lt;br /&gt;
    // ------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    // Hack setting the the display driver&lt;br /&gt;
    int argc2 = argc+2;&lt;br /&gt;
    char **argv2 = new char*[argc2];&lt;br /&gt;
    for(int i=0;i&amp;lt;argc;i++)&lt;br /&gt;
    {&lt;br /&gt;
        argv2[i] = new char[strlen(argv[i])+1];&lt;br /&gt;
        strcpy(argv2[i],argv[i]);&lt;br /&gt;
    }&lt;br /&gt;
    //char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;PalmPreSDLFb:100&amp;quot;};&lt;br /&gt;
    char *display[]={&amp;quot;-display&amp;quot;,&amp;quot;Transformed:PalmPreSDLFb:1&amp;quot;};&lt;br /&gt;
    argv2[argc] = display[0];&lt;br /&gt;
    argv2[argc+1] = display[1];&lt;br /&gt;
    for(unsigned i=0;i&amp;lt;argc2;i++)&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;%d: %s\n&amp;quot;,i,argv2[i]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // QApplication::GuiServer is akin to passing -qws on the command line&lt;br /&gt;
    // Passes argv2 / argc2 which stays alive for the entire duration of QApplication&lt;br /&gt;
    QApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
    //QApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc, argv);&lt;br /&gt;
    //QCustomApplication app(argc2, argv2,QApplication::GuiServer);&lt;br /&gt;
&lt;br /&gt;
#else&lt;br /&gt;
#warning &amp;quot;No QWS, all OK&amp;quot;&lt;br /&gt;
    QApplication app(argc, argv,QApplication::GuiServer);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QUrl url;&lt;br /&gt;
    if (argc &amp;gt; 1)&lt;br /&gt;
        url = QUrl(argv[1]);&lt;br /&gt;
    else&lt;br /&gt;
       //url = QUrl(&amp;quot;http://www.google.com/ncr&amp;quot;);&lt;br /&gt;
       url = QUrl(&amp;quot;http://www.slashdot.org&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    MainWindow *browser = new MainWindow(url);&lt;br /&gt;
&lt;br /&gt;
    #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR || defined Q_WS_QWS&lt;br /&gt;
        browser-&amp;gt;showMaximized();&lt;br /&gt;
    #else&lt;br /&gt;
        browser-&amp;gt;show();&lt;br /&gt;
    #endif&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
    const int width = 640;&lt;br /&gt;
       const int height = 480;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsScene scene;&lt;br /&gt;
&lt;br /&gt;
       QGraphicsView view(&amp;amp;scene);&lt;br /&gt;
       view.setFrameShape(QFrame::NoFrame);&lt;br /&gt;
       view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
       view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);&lt;br /&gt;
&lt;br /&gt;
       QGraphicsWebView webview;&lt;br /&gt;
       webview.resize(width, height);&lt;br /&gt;
       webview.load(QUrl(&amp;quot;http://www.slashdot.org&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
       scene.addItem(&amp;amp;webview);&lt;br /&gt;
&lt;br /&gt;
       view.resize(width, height);&lt;br /&gt;
       view.show();*/&lt;br /&gt;
&lt;br /&gt;
    rv = app.exec();&lt;br /&gt;
    return rv;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Qt-QML app ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x deployment ===&lt;br /&gt;
&lt;br /&gt;
=== 4.x stuff ===&lt;br /&gt;
* numbering of the qws stuff to avoid conflicts&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21617</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21617"/>
		<updated>2012-02-08T13:43:33Z</updated>

		<summary type="html">&lt;p&gt;DanRog: /* 4. Compiling Qt apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
We see here how to compile a Qt app for Qt on WebOS. We look at two examples that are directly taken from the Qt distribution: &lt;br /&gt;
# fancybrowser: this is a Qt-widget-based example browser. It is available in QTSDKDIR/Examples/4.8/webkit/fancybrowser&lt;br /&gt;
# webbrowser: this is a Qt-QML-based example browser. It is available in QTSDKDRIR/Demos/4.8/declarative/webbrowser&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Compiling Qt apps ===&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21607</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21607"/>
		<updated>2012-02-07T22:18:01Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
NEED TO COMPILE WEBOS manually&lt;br /&gt;
# cd&lt;br /&gt;
# make&lt;br /&gt;
# make install&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21605</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21605"/>
		<updated>2012-02-07T22:13:56Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Cross-compile ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure and cross-compile Qt. The lines below configure Qt to install in ~/qte-48:&lt;br /&gt;
&lt;br /&gt;
# '''cd ~/qt-everywhere-opensource-src-4.8.0'''&lt;br /&gt;
# '''./configure -v -prefix ~/qte-48 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-webos -depths 16,24,32 -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-nis -no-iconv -no-dbus -no-cups -no-largefile -no-accessibility -no-gtkstyle -no-qt3support -qt-gfx-vnc -plugin-gfx-vnc -no-glib -qtlibinfix 48 -xmlpatterns -exceptions -opensource -make libs -nomake tools -nomake demo -nomake examples -nomake docs -webkit -javascript-jit -script -scripttools -declarative -openssl -qt-gfx-transformed'''&lt;br /&gt;
# '''make -j4'''&lt;br /&gt;
# '''make install'''&lt;br /&gt;
&lt;br /&gt;
Hopefully you've made it so far without problems! You now have Qt in ~/qte-48.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. Compiling Qt apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21603</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21603"/>
		<updated>2012-02-07T22:08:21Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
* The reasonable development tools&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events. This step gets the WebOS Qt gfxdrivers plugin. &lt;br /&gt;
&lt;br /&gt;
The initial plugin version was written by Darron Black [1,2] and it uses SDL for graphics. With the changes in WebOS 2.x, that plugin doesn't work anymore: it uses root access to read the keyboard, but recent PDK apps are not running as root anymore but in jails. Therefore an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code]. It has also tentative support for screen rotation.&lt;br /&gt;
&lt;br /&gt;
# Cd to the Qt gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin from the svn repository: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Edit ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro to add the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# In order to support screen rotation we need to patch the &amp;quot;transformed&amp;quot; screen driver. This driver is provided by Qt to do screen rotation or offsetting and it uses as back-end the driver doing the actual access to the pixels (that would be our webos qgfxdrivers). Unfortunately the transformed driver doesn't allow to &amp;quot;notify&amp;quot; SDL when pixels are changed. A quick hack is to patch ~/qt-everywhere-opensource-src-4.8.0t/src/gui/embedded/qscreentransformed_qws.cpp. In this patch we hijack the functionality of the &amp;quot;blank&amp;quot; method (which is supposed to blank the screen) to notify the WebOS gfxdrivers before and after pixels are modified. So edit qscreentransformed_qws.cpp around lines 430 and add the two lines marked with the comments below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
    screen()-&amp;gt;blank(true);                        // ADD THIS FOR WEBOS&lt;br /&gt;
    QWSDisplay::grab();&lt;br /&gt;
    for (int i = 0; i &amp;lt; rects.size(); ++i) {&lt;br /&gt;
        const QRect r = rects.at(i) &amp;amp; bound;&lt;br /&gt;
&lt;br /&gt;
        QPoint dst;&lt;br /&gt;
        switch (trans) {&lt;br /&gt;
        case Rot90:&lt;br /&gt;
            dst = mapToDevice(r.topRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot180:&lt;br /&gt;
            dst = mapToDevice(r.bottomRight(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        case Rot270:&lt;br /&gt;
            dst = mapToDevice(r.bottomLeft(), QSize(w, h));&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        func(this, image, r.translated(-topLeft), dst);&lt;br /&gt;
    }&lt;br /&gt;
    QWSDisplay::ungrab();&lt;br /&gt;
    screen()-&amp;gt;blank(false);                       // ADD THIS FOR WEBOS&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21601</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21601"/>
		<updated>2012-02-07T21:54:44Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Get the Qt sources ===&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
=== 3.2 Qt mkspecs for WebOS ===&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.3 gfxdrivers plugin for WebOS ===&lt;br /&gt;
&lt;br /&gt;
Qt embedded needs a gfxdrivers plugin which allows Qt to show things on a screen, get keyboard input and mouse events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21599</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21599"/>
		<updated>2012-02-07T21:52:12Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. &lt;br /&gt;
&lt;br /&gt;
Without these includes, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
You're set!&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources, and sets-up Qt for cross-compilation using the Palm PDK.&lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''. This file must look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for WebOS builds with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
You're set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21597</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21597"/>
		<updated>2012-02-07T21:48:33Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file - '''/opt/PalmPDK/include/asm/hwcap.h''' (actually more includes in the /opt/PalmPDK/include/asm directory are needed) - to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include files. These files can be found in the CodeSourcery arm toolchain.&lt;br /&gt;
&lt;br /&gt;
# Download the arm toolchain &amp;quot;Sourcery G++ Lite 2009q3-67 for ARM GNU/Linux&amp;quot; from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux Mentor Graphics' website]. You need to register to download, but it's free. Make sure you get the ARM GNU/Linux Release (not the ARM EABI release!). The file you get should be called arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
# Untar this file: '''tar xvfj arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2'''&lt;br /&gt;
# Copy the entire include/asm directory to the PalmPDK: '''cp -r arm-2009q3/arm-none-linux-gnueabi/libc/usr/include/asm /opt/PalmPDK/include'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21595</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21595"/>
		<updated>2012-02-07T21:15:08Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
* a Linux development environment (here Kubuntu 11.10 running in virtualbox on a win7 host)&lt;br /&gt;
* Qt 4.8 (the process for Qt 4.7.x is mostly identical; no idea for Qt 5)&lt;br /&gt;
* OpenSSH running on the webos device to scp files to it&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
You may check that all is fine so far (or skip this - this is simply to step-by-step see if all is ok):&lt;br /&gt;
# You can invoke gcc or g++ from the PDK arm toolchain to compile some test program. E.g. '''/opt/PalmPDK/arm-gcc/bin/arm-none-linux-gnueabi-g++ hello.cpp -o hello'''&lt;br /&gt;
# You can copy this file to the usb drive on the device: '''scp hello root@ip.address.of.device:/media/internal'''&lt;br /&gt;
# You can go log on the device with novaterm: '''novaterm'''&lt;br /&gt;
# You can run your test program: '''/media/internal/hello'''&lt;br /&gt;
&lt;br /&gt;
If that works then on to the next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21585</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21585"/>
		<updated>2012-02-05T23:34:56Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are mostly the same as the linux-arm-gnueabi-g++ mkspecs. So we copy them and modify them afterwards: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# Edit the linux-webos mkspecs to set-up the cross-compiler path and other build parameters. E.g. '''vi ~/~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-webos/qmake.conf'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21583</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21583"/>
		<updated>2012-02-05T23:30:26Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are derived from the mostly the same as the linux-arm-gnueabi-g++ mkspecs. We copy this: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21581</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21581"/>
		<updated>2012-02-05T23:29:44Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are derived from the mostly the same as the linux-arm-gnueabi-g++ mkspecs. We copy this: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21579</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21579"/>
		<updated>2012-02-05T23:28:40Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are derived from the mostly the same as the linux-arm-gnueabi-g++ mkspecs. We copy this: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21577</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21577"/>
		<updated>2012-02-05T23:27:16Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
We set-up the mkspecs for WebOS (compiler parameters required for cross-compilation):&lt;br /&gt;
&lt;br /&gt;
# Cd to the qws mkspecs: '''cd ~/qt-everywhere-opensource-src-4.8.0/mkspecs/qws'''&lt;br /&gt;
# The WebOS mkspecs are derived from the mostly the same as the linux-arm-gnueabi-g++ mkspecs. We copy this: '''cp -r linux-arm-gnueabi-g++ linux-webos'''&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#for 4.7.4:&lt;br /&gt;
#include(../../common/g++.conf)&lt;br /&gt;
#include(../../common/linux.conf)&lt;br /&gt;
#include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# for 4.8&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/gcc-base-unix.conf)&lt;br /&gt;
include(../../common/g++-unix.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Base directory of gcc toolchain&lt;br /&gt;
#GCCBASE                 = /opt/PalmPDK.441/arm-gcc/bin&lt;br /&gt;
&lt;br /&gt;
GCCBASE                 = /opt/PalmPDK.palm/arm-gcc/bin&lt;br /&gt;
TSLIB_INCDIR            = /opt/PalmPDK.palm/include&lt;br /&gt;
TSLIB_LIBDIR            = /opt/PalmPDK.palm/device/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#TSLIB_INCDIR            += $$GCCBASE&lt;br /&gt;
#TSLIB_INCDIR            += /opt/PalmPDK.palm/arm-gcc/sysroot/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CFLAGS_RELEASE    = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CFLAGS_DEBUG      = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp  &lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant&lt;br /&gt;
&lt;br /&gt;
# ok below&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE  = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize&lt;br /&gt;
QMAKE_CXXFLAGS_DEBUG    = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# Not ok on 4.3.3: mix of vfp and hard&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize  &lt;br /&gt;
&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE = -O0 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
# For official pdk&lt;br /&gt;
QMAKE_CC                = $$GCCBASE/arm-none-linux-gnueabi-gcc&lt;br /&gt;
QMAKE_CXX               = $$GCCBASE/arm-none-linux-gnueabi-g++&lt;br /&gt;
QMAKE_LINK              = $$QMAKE_CXX&lt;br /&gt;
QMAKE_LINK_SHLIB        = $$QMAKE_CXX&lt;br /&gt;
QMAKE_RANLIB            = $$GCCBASE/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
#QMAKE_LINK              = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_LINK_SHLIB        = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-g++&lt;br /&gt;
#QMAKE_RANLIB            = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ranlib&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR                = $$GCCBASE/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
QMAKE_OBJCOPY           = $$GCCBASE/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
QMAKE_STRIP             = $$GCCBASE/arm-none-linux-gnueabi-strip&lt;br /&gt;
#QMAKE_AR                = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-ar cqs&lt;br /&gt;
#QMAKE_OBJCOPY           = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-objcopy&lt;br /&gt;
#QMAKE_STRIP             = /opt/PalmPDK.palm/arm-gcc/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_RELEASE   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_RELEASE += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
#QMAKE_CFLAGS_DEBUG   += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
#QMAKE_CXXFLAGS_DEBUG += --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QMAKE_INCDIR = $$TSLIB_INCDIR &lt;br /&gt;
QMAKE_LIBDIR = $$TSLIB_LIBDIR &lt;br /&gt;
QMAKE_LIBS   += -lrt -lz &lt;br /&gt;
&lt;br /&gt;
#QMAKE_LFLAGS += -Wl,--allow-shlib-undefined --sysroot=/opt/PalmPDK.palm/arm-gcc/sysroot&lt;br /&gt;
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined &lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21575</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21575"/>
		<updated>2012-02-05T23:19:15Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
This step gets the Qt 4.8 sources. &lt;br /&gt;
&lt;br /&gt;
# Cd to your home directory: '''cd ~'''&lt;br /&gt;
# Get the Qt 4.8 sources: '''http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
# Untar: '''tar xvfz qt-everywhere-opensource-src-4.8.0.tar.gz'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# V Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21573</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21573"/>
		<updated>2012-02-05T23:15:47Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: '''cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers'''&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: '''svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos'''&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21571</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21571"/>
		<updated>2012-02-05T23:09:25Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: '''contains(gfx-plugins, webos)        :SUBDIRS += webos'''&lt;br /&gt;
# ---------------------- patch transformed driver&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21569</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21569"/>
		<updated>2012-02-05T23:05:10Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos&lt;br /&gt;
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: contains(gfx-plugins, webos)        :SUBDIRS += webos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21567</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21567"/>
		<updated>2012-02-05T23:03:04Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS Qt gfxdrivers plugin. The initial plugin version was written by Darron Black [1,2]. With the changes in WebOS 2.x an extended version is required that handles keyboard input for &amp;quot;non-root&amp;quot; users. That version is available at [http://code.google.com/p/qt-webos Qt WebOS].&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21565</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21565"/>
		<updated>2012-02-05T22:58:01Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
=== 3.x WebOS gfxdrivers ===&lt;br /&gt;
&lt;br /&gt;
This step gets the WebOS qt gfxdrivers.&lt;br /&gt;
&lt;br /&gt;
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21563</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21563"/>
		<updated>2012-02-05T22:49:39Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21559</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21559"/>
		<updated>2012-02-04T23:50:34Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# You may check that all is fine&lt;br /&gt;
## You can invoke gcc or g++ from the PDK arm toolchain to compile some &amp;quot;hello world&amp;quot; test program. E.g. /opt/PalmPDK/??????????&lt;br /&gt;
## novaterm.....????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;br /&gt;
&lt;br /&gt;
== 4. apps ==&lt;br /&gt;
&lt;br /&gt;
== 5. deploy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A. Links ==&lt;br /&gt;
[1] [http://www.griffin.net/2010/02/qt-on-the-palm-pre.html Qt on the Palm Pre]&lt;br /&gt;
[2] [https://gitorious.org/~darronb/qt/qt-palm-pre Qt port to webOS by Darron Black on gitorious]&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21557</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21557"/>
		<updated>2012-02-04T23:44:48Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not yet complete - stay tuned&lt;br /&gt;
&lt;br /&gt;
= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# Check that all is fine: /opt/PalmPDK/??????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21555</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21555"/>
		<updated>2012-02-04T14:32:56Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# Check that all is fine: /opt/PalmPDK/??????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach is to provide the missing include file.&lt;br /&gt;
&lt;br /&gt;
  * Need to check name&lt;br /&gt;
  * code sourcery's toolchain&lt;br /&gt;
  * which file where&lt;br /&gt;
&lt;br /&gt;
== 3. Getting Qt 4.8, setting it up for cross-compilation ==&lt;br /&gt;
&lt;br /&gt;
To do:&lt;br /&gt;
# Get and untar the source&lt;br /&gt;
# Set-up the mkspecs&lt;br /&gt;
# Get the webos plugins/gfxdrivers -&amp;gt; credit original author -&amp;gt; link to the updated version&lt;br /&gt;
# modify the build stuff&lt;br /&gt;
# patch the transformed driver (?)&lt;br /&gt;
# ./configure command line&lt;br /&gt;
# make make install&lt;br /&gt;
# something on what's the outcome&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21553</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21553"/>
		<updated>2012-02-04T14:28:36Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device. VirtualBox can be skipped. Java may be necessary.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05] and the installation procedure. Follow the instructions on there. But essentially this boils down to:&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# Check that all is fine: /opt/PalmPDK/??????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: completing the PDK with some missing includes ==&lt;br /&gt;
&lt;br /&gt;
The Palm PDK contains an arm toolchain which can be used as-is to cross-compile Qt. This step can be skipped, unless you want maximum performance with JavaScript in WebKit.&lt;br /&gt;
&lt;br /&gt;
There is one issue with the Palm PDK. The Qt configuration script relies on the existence of one include file to know whether programs can identify the characteristics of the CPU, such as the availability of Neon instructions. Without this file, Qt will cross-compile and work, but the just-in-time JavaScript compiler in WebKit will be deactivated. This decreases JavaScript performance by a factor ~3.&lt;br /&gt;
&lt;br /&gt;
Therefore the recommended approach solut&lt;br /&gt;
&lt;br /&gt;
This include is missing&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21551</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21551"/>
		<updated>2012-02-04T14:20:14Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05]&lt;br /&gt;
# Download novacom from that page&lt;br /&gt;
# Download the SDK from that page&lt;br /&gt;
# Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
## sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
## sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
# The SDK is now in /opt/PalmPDK&lt;br /&gt;
# Check that all is fine: /opt/PalmPDK/??????????&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: Getting and setting up the Palm PDK ==&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21549</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21549"/>
		<updated>2012-02-04T14:18:47Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include:&lt;br /&gt;
# Getting and setting-up the Palm PDK&lt;br /&gt;
# Optionally: completing the PDK with some missing includes&lt;br /&gt;
# Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
# Cross-compilation of Qt 4.8&lt;br /&gt;
# Updated webos port of Qt&lt;br /&gt;
# Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;br /&gt;
&lt;br /&gt;
Qt is cross-compiled with the official Palm PDK. The PDK plays nice: it can be installed alongside the webos internals WIDK without conflicts; there is no need to modify paths or environment variables.&lt;br /&gt;
&lt;br /&gt;
Note that I haven't &amp;quot;fully&amp;quot; installed the PDK. In particular I haven't set-up the emulator. The basic stuff needed are: the arm gcc toolchain, and novacom to communicate with the device.&lt;br /&gt;
&lt;br /&gt;
# Read about the [https://developer.palm.com/content/resources/develop/sdk_pdk_download.html#linux Palm SDK 3.05]&lt;br /&gt;
## Download novacom from that page&lt;br /&gt;
## Download the SDK from that page&lt;br /&gt;
## Install novacom and the SDK following the instructions. I.e.:&lt;br /&gt;
  sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb&lt;br /&gt;
  sudo dpkg -i palm-novacom_1.0.80_i386.deb 	&lt;br /&gt;
## The SDK is now in /opt/PalmPDK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Optional: Getting and setting up the Palm PDK ==&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21547</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21547"/>
		<updated>2012-02-04T14:07:48Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Qt and QML on WebOS devices =&lt;br /&gt;
&lt;br /&gt;
This document explains how to set-up [http://qt.nokia.com Qt 4.8 (Trolltech/Nokia's cross-platform application and UI framework)] on WebOS devices, and then how to cross-compile Qt or QML apps.&lt;br /&gt;
&lt;br /&gt;
This guide assumes a Linux development environment, and Qt 4.8. The process for Qt 4.7.x is identical; no idea for Qt 5.&lt;br /&gt;
&lt;br /&gt;
The steps include&lt;br /&gt;
  * Getting and setting-up the Palm PDK&lt;br /&gt;
  * Optionally: completing the PDK with some missing includes&lt;br /&gt;
  * Getting Qt 4.8, setting it up for cross-compilation&lt;br /&gt;
  * Cross-compilation of Qt 4.8&lt;br /&gt;
  * Updated webos port of Qt&lt;br /&gt;
  * Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== 1. Getting and setting up the Palm PDK ==&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21545</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21545"/>
		<updated>2012-02-04T13:59:02Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Will cover:&lt;br /&gt;
  * Getting the PDK running&lt;br /&gt;
  * Patching the PDK with the missing asm includes&lt;br /&gt;
  * Cross-compilation of Qt 4.8&lt;br /&gt;
  * Updated webos port of Qt&lt;br /&gt;
  * Application tweaks to look for libs in the right places&lt;br /&gt;
&lt;br /&gt;
== Setting up the PDK ==&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21543</id>
		<title>HowtoQt</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=HowtoQt&amp;diff=21543"/>
		<updated>2012-02-04T09:57:40Z</updated>

		<summary type="html">&lt;p&gt;DanRog: Created page with &amp;quot;Will cover:   * Getting the PDK running   * Patching the PDK with the missing asm includes   * Cross-compilation of Qt 4.8   * Updated webos port of Qt   * Application tweaks to ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Will cover:&lt;br /&gt;
  * Getting the PDK running&lt;br /&gt;
  * Patching the PDK with the missing asm includes&lt;br /&gt;
  * Cross-compilation of Qt 4.8&lt;br /&gt;
  * Updated webos port of Qt&lt;br /&gt;
  * Application tweaks to look for libs in the right places&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Portal:Tools&amp;diff=21541</id>
		<title>Portal:Tools</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Portal:Tools&amp;diff=21541"/>
		<updated>2012-02-04T09:55:50Z</updated>

		<summary type="html">&lt;p&gt;DanRog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__notoc__&lt;br /&gt;
{{portal-header|&lt;br /&gt;
This page lists tools used in any form.&lt;br /&gt;
}}&lt;br /&gt;
{{portal-two-columns&lt;br /&gt;
|column1=&lt;br /&gt;
== webOS Internal Related Tools ==&lt;br /&gt;
&lt;br /&gt;
* [[Getting started|Accessing Developer Mode]]&lt;br /&gt;
* [[Backing_Up_via_Rsync|Backing Up via Rsync]]&lt;br /&gt;
* [[Com Palm Appinstaller]]&lt;br /&gt;
* [[Com Palm Downloadmanager|Com Palm Downloadmanager]] &lt;br /&gt;
* [[Crond|Crond]]&lt;br /&gt;
* [[Detecting Application Errors, Syslog|Detecting Application Errors, Syslog]] &lt;br /&gt;
* [[How to solve 3G data problems]]&lt;br /&gt;
* [[Important_Personal_Data_Locations|Important Personal Data Locations]]&lt;br /&gt;
&amp;lt;!--* [[/var/luna/data|/var/luna/data]]--&amp;gt;&lt;br /&gt;
* [[/usr/bin/lunaprop|/usr/bin/lunaprop]]&lt;br /&gt;
* [[Java Services|Java Services]] &lt;br /&gt;
* [[Luna Send|Luna Send]] &lt;br /&gt;
* [[PalmDatabase.db3 File|PalmDatabase.db3 File]] &lt;br /&gt;
&amp;lt;!--* [[mediadb.db3 File|mediadb.db3 File]]--&amp;gt;&lt;br /&gt;
&amp;lt;!--* [[fileindexer File|fileindexer File]]--&amp;gt;&lt;br /&gt;
* [[Profile.d|Profile.d]] &lt;br /&gt;
* [[Tellbootie|Tellbootie]]&lt;br /&gt;
* [[Webos Doctor Versions|Webos Doctor Versions]]&lt;br /&gt;
&lt;br /&gt;
==Cross-Compiling and Kernels==&lt;br /&gt;
* [[Autobuilder Setup|Autobuilder Setup]]&lt;br /&gt;
* [[WebOS Internals PDK]]&lt;br /&gt;
* [[Cross Compiling|Cross Compiling]] &lt;br /&gt;
* [[Custom Kernels|Custom Kernels]] &lt;br /&gt;
* [[Optware Cross Compilation|Optware Cross Compilation]] &lt;br /&gt;
* [[Building_a_cross_toolchain|Building a cross-toolchain for armv7 on Gentoo]]&lt;br /&gt;
* [[Adding_patches_through_git|Adding patches through git]]&lt;br /&gt;
* [[HowtoQt|How to get Qt/QML libs and apps on WebOS]]&lt;br /&gt;
&lt;br /&gt;
|column2=&lt;br /&gt;
&lt;br /&gt;
==PDK Related Pages==&lt;br /&gt;
&lt;br /&gt;
[[WebOS Internals PDK]] WebOS-Internals alternative to Palm's PDK &lt;br /&gt;
&lt;br /&gt;
[[PDK on Linux]]  Running Palm's official PDK on linux.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SDK Related Tools ([[Comparison of Editors|Comparison Chart]]) ==&lt;br /&gt;
&amp;lt;!-- Warning Do not edit the order of the top two editors (Eclipse and Komodo) --&amp;gt;&lt;br /&gt;
===Eclipse===&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse] is the editor officially supported by Palm.  You can find the Eclipse WebOS plugin [http://developer.palm.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1639 here].&lt;br /&gt;
&lt;br /&gt;
===Komodo Edit===&lt;br /&gt;
&lt;br /&gt;
[http://www.activestate.com/komodo_edit/ Komodo Edit] is an easy to use cross platform open source editor. Use along side the webOS [http://www.webos.templarian.com/komodo/ Add-on] for easier development. Complete [http://www.webos.templarian.com/komodo/ Code Completion] is also available for Mojo. [[Komodo|Wiki Page with Screensots and Install Guide]].&lt;br /&gt;
&lt;br /&gt;
===Aptana Studio===&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/studio/download Aptana Studio] is a standalone version of an Eclipse plugin. Very easy to use. You can install the Aptana WebOS plugin by directing Aptana to check [https://cdn.downloads.palm.com/sdkdownloads/1.1/eclipse-plugin/eclipse-3.4/site.xml this link]. If you do not know how to set this up, please look at official Palm documentation [http://developer.palm.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1639 here].&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DanRog</name></author>
	</entry>
</feed>