分类: Java
2009-02-11 01:07:51
Qt is a cross-platform application development framework. For phoneME Advanced MR2, both PBP and MIDP use Qt as a portability layer for their graphics implementations. PBP uses Qt 3.x for Linux/x86 host-based development and Qt Embedded 2.3.x for device-based development. MIDP uses only Qt Embedded 2.3.x is as a portability layer.
Ubuntu Linux includes the Debian package management system that provides prebuilt packages for a variety of applications, libraries and other system resources. The Ubuntu package repository includes prebuilt packages for Qt 3.x and these make setup for the CDC build system much easier for PBP.
However, MIDP requires Qt Embedded 2.3.x, which is not available in prebuilt package form. This means that to use Qt Embedded 2.3.10 with phoneME Advanced MR2, you will have to download the source code bundle from the Trolltech web site and build it.
Qt has many build options, not all of which are appropriate for the devices and development style used by phoneME Advanced MR2. These build notes show how to configure the Qt Embedded build system to generate libraries and header files that are appropriate for use with the phoneME Advanced MR2 build system.
There are basically two build files described here:
Note: Qt Embedded 2.3.10 is an older version of the Qt framework that should be built with the gcc/g++ 3.x compilers.
The source bundle for Qt Embedded 2.3.10 can be downloaded from the Trolltech ftp site:
% wget ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.10-free.tar.gz
Then unbundle it into a suitable directory.
#ifndef QT_H
#endif // QT_H
#define QT_NO_QWS_CURSOR
#define QT_NO_QWS_MOUSE_AUTO
#define QT_NO_CODECS
#define QT_NO_FREETYPE
#define QT_NO_BDF
#define QT_NO_STYLE_POCKETPC
#define QT_NO_STYLE_AQUA
#define QT_NO_STYLE_MOTIF
#define QT_NO_STYLE_PLATINUM
#define QT_NO_QWS_BEOS_WM_STYLE
#define QT_NO_QWS_KDE2_WM_STYLE
#define QT_NO_QWS_KDE_WM_STYLE
#define QT_NO_QWS_WINDOWS_WM_STYLE
#define QT_NO_UNICODETABLES
#define QT_NO_IMAGEIO_MNG
#define QT_NO_PROPERTIES
#define QT_NO_COLORNAMES
#define QT_NO_IMAGEIO_PPM
#define QT_NO_NETWORKPROTOCOL
#define QT_NO_PICTURE
#define QT_NO_PRINTER
#define QT_NO_QWS_SAVEFONTS
#define QT_NO_COLORDIALOG
#define QT_NO_FILEDIALOG
#define QT_NO_FONTDIALOG
#define QT_NO_DIAL
#define QT_NO_DRAGANDDROP
#define QT_NO_IMAGE_TEXT
#define QT_NO_INPUTDIALOG
#define QT_NO_PRINTDIALOG
#define QT_NO_PROGRESSDIALOG
#define QT_NO_SEMIMODAL
#define QT_NO_SIZEGRIP
#define QT_NO_SPLITTER
#define QT_NO_WORKSPACE
#define QT_NO_DOM
#define QT_NO_EFFECTS
#define QT_NO_TRANSFORMATIONS
#define QT_NO_QMEMORYFILE
#undef QT_USE_MALLOC_FOR_NEW
% ln -s src/tools/qconfig-pmea.h include/
The build script below is an example of how to build Qt Embedded that can be modified for your local system.
#!/bin/sh
export QTEDIR=`pwd`/qt-2.3.10
export QTDIR=$QTEDIR
cd $QTEDIR
./configure \
-shared \
-xplatform linux-x86-g++ \
-qconfig pmea \
-qvfb \
-system-jpeg \
-qt-libpng \
-depths 16 \
-keypad-mode \
-debug
make
The CDC build system can use the target library and header files as they are in the Qt Embedded build hierarchy, or you can relocate just the library and header files to a target directory.
Here's an example of how to do this:
#!/bin/sh
export QTDIR=`pwd`/qt-2.3.10
export TARGETDIR=`pwd`/target
mkdir -p $TARGETDIR/lib
cp -RLf $QTDIR/lib/* $TARGETDIR/lib
mkdir -p $TARGETDIR/include
cp -RLf $QTDIR/include/* $TARGETDIR/include