[Deven] porting QT + qtopia on Linux (complete ...)

Source: Internet
Author: User
Author: Kong defeng
Date: 2005-11-23

-- Directory --
1. Introduction
2. Preparations
2.1 goals
2.2 Software Package
2.3 establish environment
3. PC platform Compilation
3.1 compile QT
3.2 compile qtopia
3.3 test qtopia
4. Cross-Compilation of the Target Platform
4.1 cross-compile QT
4.2 cross-compile qtopia
5. Port Related device interfaces in QT
5.1 mouse
5.2 Touch Screen
6. Port Related device interfaces in qtopia
6.1 Power Management Device
7. Write and transplant the QT Program
8. Write and transplant the qtopia Program
X. Tips

-- Body --

1. Introduction
QT is a widely used Graph System in Linux. Users often work with the KDE Desktop Environment. Note that what we see and operate on KDE, rather than QT. QT is only a set of library functions (class libraries), and KDE is the executable program. At the same time, Kde provides a set of library functions (class libraries) for other programs to conveniently operate on it ).
Qt on a PC is based on the X11 graphics system. It is usually not necessary to embed the data in devices. You only need to use QTE (QT embedded) the X11 and QT libraries on the PC platform are available.
On the other hand, the embedded device is subject to many restrictions, and the desktop system cannot directly use the existing system on the PC. Qtopia is a desktop system equivalent to KDE. It can be configured as phone or Pocket PC based on the needs of embedded devices.

2. Preparations
2.1 goals
First, you must clarify what you are going to do and what you will do.
Our goal is to use QTE-based desktop qtopia on our own development board.
Our job is to first migrate the data to the ARM platform after the PC is completed. First, compile the QTE library and then compile qtopia. Because the system is related to specific devices (such as touch screen, clock, and power management devices), the transplantation of device interfaces is also required.

2.2 Software Package
System Platform: RedHat 9 (fully installed)
Qt-embedded-2.3.7.tar.gz (QTE Library)
Qt-x11-2.3.2.tar.gz (to generate the appropriate qtdesigner and qvfb)
Qtopia-free-1.7.0.tar.gz (QTE Desktop Environment Program)
Tmake-1.11.tar.gz (used during compilation)
E2fsprogs-1.35.tar.gz (only use the uuid library in it)
After downloading these packages, create a work environment. Assume that all software packages are downloaded to the user directory, which is usually/root.

2.3 establish environment
# Cd ~
# Mkdir x86-qtopia

# Tar zxvf qt-x11-2.3.2.tar.gz
# Mv qt-2.3.2 qt-x11

# Cd x86-qtopia
# Tar zxvf ../tmake-1.11.tar.gz
# Tar zxvf ../qt-embedded-2.3.7.tar.gz
# Tar zxvf ../qtopia-free-1.7.0.tar.gz
# Tar zxvf ../e2fsprogs-1.35.tar.gz
# Music tmake-1.11 tmake
# Music qt-2.3.7/QT
# Music qtopia-free-1.7.0 qtopia
# Mv e2fsprogs-1.35 e2fsprogs

# Cpx86-qtopiaarm-qtopia-RF
Remember, the x86-qtopia directory under the user directory is the working environment compiled on the PC, arm-qtopia is the cross-compiled working environment of the ARM platform, the qt-x11 is public.

Next, you must compile the qt-x11, mainly to compile and generate the qtdesigner and qvfb. The qvfb program is not installed in the system and needs to be compiled by ourselves. Qtdesigner is related to the version of the QT library, when we use the PC and QTE version does not match the qtdesigner, The qt-x11 on the PC may be able to use the control on the QTE is not implemented, the application compilation fails. So when we use QTE 2.3, we must use the same version of qt-x11 to compile the qtdesigner and qvfb.
# Cd ~ Qt-x11
# Export qtdir = $ pwd
# Echo Yes |./configure-static-no-xft-no-OpenGL-no-Sm
# Make-C src/MoC
# Cp src/MOC Bin
# Make-C SRC
# Make-C tools/designer
# Make-C tools/qvfb
# Cp tools/qvfb Bin
# Strip bin/UIC bin/MOC bin/designer bin/qvfb
# Cp qt-x11/bin/* QT/bin-F
# Cp qt-x11/bin/* QT/bin-F

3. PC platform Compilation
Make preparations before Compilation: open a console and set the environment variables.
# Cd ~ X86-qtopia
# Export qtdir = $ PWD/QT
# Export qpedir = $ PWD/qtopia
# Export tmakedir = $ PWD/tmake
# Export tmakepath = $ tmakedir/lib/qws/Linux-generic-G ++
# Export Path = $ qtdir/bin: $ qpedir/bin: $ tmakedir/bin: $ path

3.1 compile QTE
# Cd $ qtdir
# CP $ qpedir/src/QT/qconfig-qpe.h src/tools/-F
# (Echo yes; echo no) |./configure-platform Linux-generic-G ++-qconfig qpe-Depths 16,24, 32
# Make-c src clean
# Make-C SRC
Check if the $ qtdir directory has a QT library?

3.2 compile qtopia
# Cd $ qpedir/src
#./Configure
# Make clean
# Make

3.3 test qtopia
An exciting moment is coming. If this step is successful, application development can be performed.
# Cd ~ X86-qtopia
# Mkdir Dist
# Cd Dist
# Cp-AF ../QT/lib /.
# Cp-AF ../qtopia/apps.
# Cp-AF ../qtopia/bin.
# Cp-AF ../qtopia/plugins.
# Cp-AF ../qtopia/i18n.
# Cp-AF ../qtopia/pics.
Because security.png is incorrect, you must perform the following operations:
# Cd pics
# Pngtopnm security.png> A. PNM
# Pnmtopng A. PNM> security.png
Because the current directory must be $ qtdir/bin when qpe is running, you cannot run bin/qpe in the $ qtdir directory.
# Export qtdir = ~ /X86-qtopia/QT
# Cd $ qtdir/bin
#./Qvfb &
#./Qpe &
Have you seen the qpe interface in qvfb? I see ~!

4. Cross-Compilation of the Target Platform
Like compiling on a PC, you need to set environment variables after opening a console.
# Cd ~ /ARM-qtopia
# Export qtdir = $ PWD/QT
# Export qpedir = $ PWD/qtopia
# Export tmakedir = $ PWD/tmake
# Export tmakepath = $ tmakedir/lib/qws/Linux-arm-G ++
# Export Path = $ qtdir/bin: $ qpedir/bin: $ tmakedir/bin: $ path
4.1 cross-compile QT

4.2 cross-compile qtopia

5. Port Related device interfaces in QT
5.1 mouse

5.2 Touch Screen

6. Port Related device interfaces in qtopia
6.1 Power Management Device

7. Write and transplant the QT Program

8. Write and transplant the qtopia Program

X. Tips
@ The version of the compiler is very important during migration. qte-2.3.7 works normally in the 3.2 compiler of redhat9, but compilation fails in the gcc-3.4.2 ora4 compiler. according to the test, the use of gcc-3.2 on the PC platform can be smoothly compiled, the use of gcc-2.95.2 on the ARM platform can be smoothly passed (gnuarm compiler does not seem to work, with the armv4l-unkown-linux-gcc In the Hua Heng CD can be compiled through)
@ During the compilation process, you will be prompted to download e2fsprogs-libs-1.38.tar.gz, which contains UUID-related code.
@ The Compiler needs to be specified during compilation. There are many files in the configs directory of QT to modify the definitions in Linux-arm-G ++. for example, the arm-Linux-GCC compiler is used by default, while the gnuarm arm-elf-GCC compiler is used, replace all the arm-Linux-prefixes in the file with arm-elf.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.