Tutorial on setting up the QT platform environment

Source: Internet
Author: User

QT PlatformThis document describes how to build an environment.QT PlatformThis article provides a detailed description of the application.QT PlatformFor more information, see the detailed description.

Embedded/QT Platform Construction

You can download the free version of the Embedded/Qt platform provided by Trolltech on its website. The files to be downloaded already exist in this experiment directory, before the experiment, copy the three files used in this experiment to the/root/pxa270Qt directory. The following steps assume that you are operating on the/root/pxa270Qt platform.

1. Unzip the installation package and set Environment Variables

1) install Tmake

 
 
  1. cd~/pxa270Qt  
  2. tar–xzftmake-1.13.tar.gz  
  3. exportTMAKEDIR=$PWD/tmake-1.13 

2) install Qt2.3.2

 
 
  1. cd~/pxa270Qt  
  2. tar–xzfqt-x11-2.3.2.tar.gz  
  3. exportQT2DIR=$PWD/qt-2.3.2 

3) install Qt/Embedded

 
 
  1. cd~/pxa270Qt  
  2. tar–xzfqt-embedded-2.3.10-free.tar.gz  
  3. exportQTEDIR=$PWD/qt-2.3.10 

The setting of environment variables is very important. It is related to whether these installation packages can be correctly installed and compiled. The following describes these environment variables:

TMAKEDIR: indicates the Tmake tool used to compile Qt/Embedded.

QT2DIR: a folder pointing to a Qt-X112.3.2

QTEDIR: a folder pointing to a Qt-Embedded2.3.10

2. Compile Qt/Embedded

1) BuildQt2.3.2

 
 
  1. cd$QT2DIR  
  2. exportTMAKEPATH=$TMAKEDIR/lib/linux-g++  
  3. exportQTDIR=$QT2DIR  
  4. exportPATH=$QTDIR/bin:$PATH  
  5. exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH  
  6. ./configure-no-xft  
  7.  
  8. make  
  9.  
  10. mkdir$QTEDIR/bin  
  11. cpbin/uic$QTEDIR/bin 

. /Configure is used to configure Qt. It includes many options, such as adding "-no-opengl". To learn more, enter. /configure -- help to get more help information. After compilation, copy the generated/bin/uic to the new directory bin under $ QTEDIR, because this tool will be used in subsequent compilation of Qt/Embedded.

2) BuildQvfb

 
 
  1. exportTMAKEPATH=$TMAKEDIR/lib/linux-g++  
  2. exportQTDIR=$QT2DIR  
  3. exportPATH=$QTDIR/bin:$PATH  
  4. exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH  
  5. cd$QTEDIR/tools/qvfb  
  6. tmake-oMakefileqvfb.pro  
  7.  
  8. make  
  9.  
  10. mvqvfb$QTEDIR/bin/ 

In this step, buildqvfb creates a link to the static library from Qt/Embedded2.3.10 to Qt2.3.2. The qvfb tool is used to generate Virtualframebuffer, which is a very useful tool that can simulate the display on the development board. If there is no problem running in Virtualframebuffer, it can be directly run on the Development Board through cross-compilation.

3) BuildQt/Embedded

 
 
  1. cd$QTEDIR  
  2. exportTMAKEPATH=$TMAKEDIR/lib/qws/linux-x86-g++  
  3. exportQTDIR=$QTEDIR  
  4. exportPATH=$QTDIR/bin:$PATH  
  5. exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH  
  6. ./configure-no-xft-qvfb-depths4,8,16,32  
  7. make 

In the configuration. in/configure,-qvfb is used to support Virtualframebuffer,-depths4, 8, 16, and 32. It supports 4-bit, 8-bit, 16-bit, and 32-bit display depth, in addition, you can add jpeg and-gif files such as-syestem-jpeg to support jpeg and gif files. The Configuration System also supports adding System Options for specific platforms. However, generally, any Linux system that supports framebuffer can use the "linux-generic-g ++" platform. You can run the./configure -- help Command to view detailed configuration information.

3. View running results

View the running result. If the above steps are successfully compiled, you can view the running result by running the demo that comes with Qt/Embedded.

Run on the framebuffer of the host machine:

 
 
  1. cd$QTEDIR/examples/launcher  
  2. ./launcher-qws 

Run on Virtualframebuffer:

 
 
  1. exportQTDIR=$QTEDIR  
  2. exportPATH=$QTEDIR/bin:$PATH  
  3. exportLD_LIBRARY_PATH=$QTEDIR/lib:$QT2DIR/lib:$LD_LIBRARY_PATH  
  4. cd$QTEDIR/examples/launcher  
  5. qvfb-width640-height480&  
  6. sleep10  
  7. ./launcher-qws 

The running result is as follows:

Figure 7-1Qt/EmbeddedDemo

After completing the above steps, we have already established and developed it on the local machine.Qt PlatformApplication environment.

Summary:

QT PlatformThe environment setup tutorial is complete.QT PlatformWe hope everyone can help you build the environment.

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.