Establishment of the QT Development Environment

Source: Internet
Author: User
Development Mode:

Simulate frame buffering through qvfb on the host federa

After development, use QT-embedded to re-compile and download the program to run on ARM (QT needs to be installed on arm)

Software required for development:
  • Qtopia-free-1.7.0.tar.gz
  • Qt-x11-2.3.2.tar.gz
  • Tmake-1.11.tar.gz
  • Qt-embedded-2.3.7.tar.gz
Set qvfb:./configure-qconfig-qvfb-depths, 16, 32

 

Program running method:./qvfb &

./Canvas-qws (this method is generally used for debugging)

Note: The default display window size of QT is 640 x320 pixels, and other window sizes are specified: qvfb-width 480-Height & if you need to install the self-developed qtopia, the following steps are required:

1. Create the folder Hello under the/x86-qtopia directory, write the corresponding program, and execute:

Make

After compilation, the program is generated under $ qpedir/bin.

2. Set the configuration file hello. desktop and copy the configuration file to $ pedir/apps/applications:

Configuration File Content:

[Desktop entry]

Comment = An Hello demo.

Exec = Hello

Icon = Hello

Type = Application

Name = Hello

Run the following command:

CP hello. Desktop $ pedir/apps/Applications

3. Execute the program:

Qvfb &

Qpe

4. Modify the icon:

Design a 32*32 PNG image to the <qtopia>/pics/inline directory, and then convert it with qembed.

Qembed-images $ qpeidr/pics/inline/*. *> $ qpeidr/src/librabies/qtopia/inlinepics_p.h

Installation of host QT

**************************************** **************************************** ***************

Note: The following installation steps are successfully tested in the RedHat 9 system. For installation steps, refer to the magicarm2410 platform lab manual.

Create directory x86-qtopia under/zylinux all packages are copied to this directory

**************************************** **************************************** ***************

1. Install tmake

Tar xzvf tmake-1.11.tar.gz

Export tmakedir =/zylinux/x86-qtopia/tmake-1.11

Export tmakepath =/zylinux/x86-qtopia/tmake-1.11/lib/qws/linux-x86-g ++

Export Path = $ path:/zylinux/x86-qtopia/tmake-1.11/bin/

Tmake configuration file: tmake. conf

Tmake template: App. t is used to generate the makefile of the application

Lib. t is used to generate the makefile of the library file.

Subdirs. t is used to create the makefile of the program in the compiled subdirectory.

2. Install QT/X11

Tar xzvf qt-x11-2.3.2.tar.gz

CD qt-2.3.2/

Export qtdir = $ pwd

Export Path = $ qtdir/bin: $ path

Export LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH

./Configure-static-no-xft-no-OpenGL

Make

Make-C tools/qvfb

MV tools/qvfb Bin

Export qtedir = $ qtdir

CP bin/UIC $ qtedir/bin

CD ..

Qt configuration is complicated./configure -- Help

Make-C tools/designer graphic designer

3. Decompress qtopia

Tar xzvf qtopia-free-1.7.0.tar.gz

Export qpedir = $ PWD/qtopia

4. Install QT/embeded

The qpe configuration file is used here.

Tar xzvf qt-embedded-2.3.7.tar.gz

CD qt-2.3.7

Export qtdir = $ pwd

Export qtedir = $ qtdir

Export Path = $ qtdir/bin: $ path

Export LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH

CP $ qpedir/src/QT/qconfig-qpe.h src/tools

(Echo yes; echo yes) |./configure-platform linux-x86-g ++-qconfig qpe-qvfb-Depths 4,8, 16, 32

Make sub-Src // make-C SRC

CD ..

5. Install qtopia

CD qtopia-1.7.0

Export qtdir = $ qtedir

Export qpedir = $ pwd

Export Path = $ qtedir/bin: $ path

CD SRC

./Configure-platform linux-x86-g ++

Make

CD ../..

**************************************** **************************************** ***************

**************************************** **************************************** ***************

Configure the script (complete installation in step 5 above, all the files need to be placed under/zylinux/x86-qtopia and run./build ):

#! /Bin/bash

Echo remove old dirs

Rm-RF tmake

Rm-RF QT

Rm-RF qt-x11

Rm-RF qtopia

Echo unpack all packages

Tar xzvf tmake-1.11.tar.gz

Tar xzvf qt-embedded-2.3.7.tar.gz

Tar xzvf qt-x11-2.3.2.tar.gz

Tar xzvf qtopia-free-1.7.0.tar.gz

Echo rename

Music tmake-1.11 tmake

Music qtopia-free-1.7.0 qtopia

Music qt-2.3.7 QT

Echo start install Qt-X11

CD qt-2.3.2

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 bin/UIC $ qtedir/bin

CP bin /? * ../QT/bin

CD ..

# CP $ qtdir/bin /? * QT/bin

MV qt-2.3.2 qt-x11

Echo start setting env-VaR

Export qtdir = $ PWD/QT

Export qtedir = $ qtdir

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

Export LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH

Echo start build QT/embedded

CD QT

Make clean

CP $ qpedir/src/QT/qconfig-qpe.h src/tools

(Echo yes; echo yes) |./configure-platform Linux-generic-G ++-qconfig qpe-qvfb-Depths 16,24, 32

Make-C SRC

CD ..

Echo start build qtopia

CD qtopia/src

./Configure-platform Linux-generic-G ++

Make

Echo OK

The installation path is as follows:

Qt-embedded-2.3.7.tar.gz/zylinux/x86-qtopia/QT

Qtopia-free-1.7.0.tar.gz/zylinux/x86-qtopia/qtopia

Qt-x11-2.3.2.tar.gz/zylinux/x86-qtopia/qt-x11

Tmake-1.11.tar.gz/zylinux/x86-qtopia/tmake

**************************************** **************************************** ***************

**************************************** **************************************** ***************

After installation, export the environment variables before development:

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

**************************************** **************************************** ***************

**************************************** **************************************** ***************

NOTE: If some databases cannot be found during running, you need to set the library path:

Add the path of the QT Library to the/etc/lD. So. conf file.

/Zylinux/x86-qtopia/lib

/Zylinux/x86-qtopia/qtopia/lib

After the path is added, run ldconfig as root in the/etc directory to make the QT library take effect.

Note: Undefined reference to vtable for "XXX: XXX" SOLUTION

If q_object is added to a class, the link prompt is: Undefined reference to vtable for "XXX: XXX". No problem occurs if you delete it.

Solution: When qmake generates makefile, the Class header file does not contain q_object. Therefore, MoC XXX is not used in the corresponding makefile. H command. run qmake again to solve the problem. when searching for a solution, qmake does not handle the problem. the q_object in the CPP file. in the CPP file, undefined reference to vtable for "XXX: XXX" will also be generated ". in this case, use moc xxxx first. CPP generates the corresponding MOC file and then includes it. CPP to solve this problem.

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.