Log In |  Site Map  | 
Location  
Powered by Embedian :: Trusted Embedded ARM/XSCALE Computers Embedian Embedian Embedian Embedian
  
   Advanced Search
     Monday, Sep 06, 2010
  Welcome!

QT Developer's Manual

QT IDE and Developers Manual for Debian ARM Linux


QT IDE and Developers Manual for Debian ARM Linux
Table of Contents:
Chapter 1 Install Eclipse
  • 1.1. Introduction
  • 1.2. Install JDK/JRE
  • 1.3. Install Eclipse
  • Chapter 2 Setup QT Development Environment for Windows
  • 2.1. CDT Plugin
  • 2.2. MinGW Compiler
  • 2.3. QT Plugin for Windows and QT for MinGW
  • Chapter 3 Examples Demostration
  • 3.1. Hello World!
  • 3.2. Xform
  • Chapter 1. Install Eclipse


    1.1. Introduction

    This document mainly describes how to write and build QT programs under Windows XP operating system using Eclipse IDE for Embedian ARM-based single board computers and embedded box computers. This document could also apply to all those products of third parties that support Debian ARM Linux. And since the software architecture is source-level compatible to x86 system, if programmers would like to develop QT program for x86 system, this document should also satisfy for all main Linux distribution.

    Because of no cross-compiler for X11 and QT at the time that author wrote this document, the gcc compiler is included in Embedian products. The programming experience is the same as that in the x86 Linux systems.

    If programmers have programs running on other ARM platform, the binary should also be running on Embedian platform. And if programmers don't use X11 and QT library and previously used ARM cross-compiler to develop their program, you could keep the original developing way and just download the binary to Embedian's platform.

    There are three ways to develop QT program for Embedian products:

    • Programming directly under Embedian's product.
    • Programming under Linux PC. After done, download the source code to device and make again. (Source-Level compatible with x86 system.)
    • Program under Windows IDE. After done, download the source code to device and make again. (Source-Level compatible with x86 system.)

    The document mainly describes the third point. If you are a Linux programmer, we assume you understand how to programming under Linux environment. Or you could refer this document, and install Eclipse IDE under Linux and apply the same way.

    The QT library version we used in our product now is 3.3.6. Since the QT 4.x version is not backward compatible to QT 3.x. So make sure your QT library version in the PC you use is 3.x. Or just follow the instruction in this document.

    Except Eclipse, QT could also combine with Visual Studio or Boland C++ IDE. You could purchase QT development tool and get QT support from Trolltech for other IDE integration. If you prefer Eclipse, this document should be a good guide. All software mentioned in this document could be downloaded from internet, and you could also find in the CDs if you purchase our evaluation kit.

    Following are the steps to build QT programs on Windows Eclipse IDE.

    • Install JRE
    • Install Eclipse
    • Install Eclipse Languages Plugin (Optional)
    • Install CDT
    • Install MinGW
    • Install C++ Formatter Plugin (Optional)
    • Install QT-WIN-FREE
    • Setup Environmental Variables
    • Use the standard make c++ wizard
    • Create an external tool that runs qmake.
    • Add your make targets.
    • Write your own pro files and use the external tool to generate the Makefile
    • Include the $QTDIR/include dir in your project settings
    • Build
    • Download to device
    • Change the directory of .pro file
    • Makefile
    • Build

    1.2. Install JDK/JRE

    Eclipse is written by JAVA language. To run Eclipse, we need Sun JRE/JDK. For Eclipse 3.2, the minimum JRE version requirement is 1.4.2. The setup program of Eclipse doesn't natively include JRE. And Windows JVM support is up to Java 1.1. Therefore, to install Eclipse, we need to install JRE first. The JRE version we used is 1.4.2.

    If you purchased the evaluation kit, you could find the JRE/JDK installation file in our CD or go to Sun website at here (http://java.sun.com/j2se/1.4.2/download.html) and you will see:

    Figure 1-1 Snapshot of Downloading JDK/JRE for Windows (1)

    Click on "Download J2SE SDK" and you should see:

    Figure 1-2 Snapshot of Downloading JDK/JRE for Windows (2)

    Download the  j2sdk-1_4_2_12-windows-i586-p.exe  file.

    Install JDK
    After downloading the file, follow the set up instruction, you must have an Administrator privileges to precede the installation.

    Figure 1-3 Install JDK under Windows Environment

    Click on "Nex" and follow the instruction to finish set up.

    Note:
    If you working under Linux PC, you will need download the "j2sdk-1_4_2_12-linux-i586-rpm.bin" file.

    Figure 1-4 Snapshot of Downloading JDK/JRE for Linux

    After downloading the file, login as a root privilege and precede the installation.

    First, change the file attribute to be executable.

    [root@dns1~]chmod 711 j2sdk-1_4_2_12-linux-i586-rpm.bin

    Next, execute the binary file and it will produce an rpm file "j2sdk-1_4_2_12-linux-i586-rpm".

    [root@dns1~]./j2sdk-1_4_2_12-linux-i586-rpm.bin

    Then use rpm to install the JDK.

    [root@dns1~]rpm -ivh j2sdk-1_4_2_12-linux-i586-rpm

    After installation, you will see JDK installed under /usr/java/j2sdk1.4.2_12 this directory.


    1.3. Install Eclipse

    You could find Eclipse setup file in the CD or go to Eclipse website at http://www.eclipse.org/downloads/

    Figure 1-5 Snapshot of Downloading Eclipse 3.2 for Windows

    The version we tried is Ecplise 3.2. It is easy to install the Eclipse. Just unzip the "eclipse-SDK-3.2-win32.zip" file to some folder. We unzip the "eclipse-SDK-3.2-win32.zip" file to E:\eclipse-SDK-3.2-win32 folder. Double click the E:\eclipse-SDK-3.2-win32\Eclipse\eclipse.exe, the Eclipse program will be launched. During first launch, the Eclipse will ask you where to store your projects in a folder call workplace. Choose your directory and click the "use this as the default and do not ask again" check box. (In the example here we use E:\workplace) You could also create a shortcut to Desktop or Windows launch menu if you like.

    Figure 1-6 First Launch Eclipse Program

    Note:
    For Linux users installing Eclipse program, go to Eclipse website at here. Download the file "eclipse-SDK-3.2-linux-gtk.tar.gz" or find this file in the CD.

    Figure 1-7 Snapshot of Downloading Eclipse for Linux

    We will install the Eclipse under the /opt directory. It is also easy to install Eclipse under Linux. Just tar the file into /opt directory.

    [root@dns1~]cd /opt
    [root@dns1~] tar -zxvf eclipse-SDK-3.2-inux-gtk.tar.gz

    It will tar the file into /opt/eclipse directory. You could run ./opt/eclipse/eclipse directly and like Windows, the program will ask you where to store your projects in a folder call workplace. Choose your directory and click the "use this as the default and do not ask again" check box.

    You could also write a script that every user could execute Eclipse program and default workplace is in /home/work as following.

    #!/bin/bash
    #
    #File: eclipse.sh
    #
    #Execute Eclipse Version 3.2
    #

    export JAVA_HOME=/usr/java/j2sdk1.4.2_12
    export CLASSPATH=/usr/java/j2sdk1.4.2_12/lib
    cd /opt//eclipse
    ./eclipse -vm /usr/java/j2sdk1.4.2_12/bin/java -data ~/workspace &

    The -vm parameter specify which JVM to execute Eclipse and -data parameter specify the project directory to home (~) worksplace directory.

    Copy the file eclipse.sh into "/usr/local/bin" directory and set the privilege as following:

    [root@dns1~]cp eclipse.sh /usr/local/bin
    [root@dns1~]chmod 755 /usr/local/bin/eclipse.sh
    Now you could execute Eclipse program by typing "eclipse.sh" and you will see:

    Figure 1-8 Snapshot of Launching Eclipse for Linux

    You could also set an alias so that you could only type "eclipse" instead of "eclipse.sh". Modify "which-2.sh" file under /etc/profile.d directory. Add this line at the end of the file.

    alias eclipse='/usr/local/bin/eclipse.sh'

    You could also set a shortcut on desktop like Windows system. On Linux desktop, right click the mouse. Choose the third option "Create Launcher". A "Create Launch" window will pop out. Type "Eclipse" under Name and "/usr/local/bin/eclipse.sh" under Command and choose "No Icon" at the bottom. An icon browsing window will pop out, and type "/opt/eclipse" at the top of icon browsing window. Use mouse to click "icon.xpm" file. An Eclipse Launch Icon will appear on the Desktop.

    Figure 1-9 Add Eclipse Shortcut to Linux Desktop

    With CDT plugin described in the next section, you could start to develop your QT program using QT library and gcc on your Linux PC. Make sure your QT library is 3.3.x version.

    The remaining of this document will focus on Windows platform. However, it is almost the same as Linux platform since Eclipse is platform independent.

    Figure 1-10 Eclipse Program

    You could also install multi-language plugin for Eclipse.

    You could find the file "NLpack1-eclipse-SDK-3.2-win32" (for Windows) or "NLpack1-eclipse-SDK-3.2-gtk" (for Linux) in the CD or download from here.

    Figure 1-11 Eclipse Multi-Language Plugin Download

    Copy the corresponding directories into Eclipse install directory and the plugin will work.

    This chapter, we detailed install Eclipse and the plugins under Windows and Linux. Next section, we will detail how to setup QT development environment under Windows.

    Chapter 2 Setup QT Development Environment for Windows
    Back
     | Home | About Embedian | Shipping & Returns | Privacy Policy | Conditions of Use | ContactUs | WiKi | 
    Parse Time: 0.553 - Number of Queries: 99 - Query Time: 0.10605255682373