Difference between revisions of "HowtoQt"

From WebOS Internals
Jump to navigation Jump to search
m
Line 59: Line 59:
 
=== 3.x WebOS gfxdrivers ===
 
=== 3.x WebOS gfxdrivers ===
  
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 "non-root" users. That version is available at [http://code.google.com/p/qt-webos Qt WebOS].
+
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 "non-root" users. That version is available from [http://code.google.com/p/qt-webos Qt gfxdrivers plugin for WebOS on Google Code].
  
 
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers
 
# Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers
 
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos
 
# Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos
 +
# Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: contains(gfx-plugins, webos)        :SUBDIRS += webos
  
  

Revision as of 00:05, 6 February 2012

This document is not yet complete - stay tuned

Qt and QML on WebOS devices

This document explains how to set-up 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.

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.

The steps include:

  1. Getting and setting-up the Palm PDK
  2. Optionally: completing the PDK with some missing includes
  3. Getting Qt 4.8, setting it up for cross-compilation
  4. Cross-compilation of Qt 4.8
  5. Updated webos port of Qt
  6. Application tweaks to look for libs in the right places

1. Getting and setting up the Palm PDK

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.

Note that I haven't "fully" 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.

  1. Read about the Palm SDK 3.05 and the installation procedure. Follow the instructions on there. But essentially this boils down to:
  2. Download novacom from that page
  3. Download the SDK from that page
  4. Install novacom and the SDK following the instructions. I.e.:
    1. sudo dpkg -i palm-sdk_3.0.5-svn528736-pho676_i386.deb
    2. sudo dpkg -i palm-novacom_1.0.80_i386.deb
  5. The SDK is now in /opt/PalmPDK
  6. You may check that all is fine
    1. You can invoke gcc or g++ from the PDK arm toolchain to compile some "hello world" test program. E.g. /opt/PalmPDK/??????????
    2. novaterm.....????????


2. Optional: completing the PDK with some missing includes

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.

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.

Therefore the recommended approach is to provide the missing include file.

 * Need to check name
 * code sourcery's toolchain
 * which file where

3. Getting Qt 4.8, setting it up for cross-compilation

To do:

  1. Get and untar the source
  2. Set-up the mkspecs
  3. Get the webos plugins/gfxdrivers -> credit original author -> link to the updated version
  4. modify the build stuff
  5. patch the transformed driver (?)
  6. ./configure command line
  7. make make install
  8. something on what's the outcome

3.x WebOS gfxdrivers

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 "non-root" users. That version is available from Qt gfxdrivers plugin for WebOS on Google Code.

  1. Cd to the gfxdrivers directory: cd ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers
  2. Get the WebOS gfxdrivers plugin: svn checkout http://qt-webos.googlecode.com/svn/trunk/ webos
  3. Add to ~/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/gfxdrivers.pro the line: contains(gfx-plugins, webos) :SUBDIRS += webos


4. apps

5. deploy

A. Links

[1] Qt on the Palm Pre [2] Qt port to webOS by Darron Black on gitorious