Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Running Qt Extended

Introduction

This document describes the commands required to run Qt Extended. It is assumed that the Qt Extended binaries have been installed using either:

  • an SDK package
  • or have been built using a source package according to the Build Instructions.

Qt Extended can be run connected to either the Qt Virtual Framebuffer(QVFb) on a desktop or a real framebuffer on an embedded device. Running Qt Extended connected to the QVFb is ideal for developing code, debugging and demonstrating a product. However Qt Extended will need to be run on the embedded device to provide a clearer indication of performance and how well the embedded device's hardware interacts with Qt Extended.

Running Qt Extended on an embedded device requires different binaries from those used to run Qt Extended on the desktop. Creating binaries for an embedded device is not difficult and is done using a cross-compiler. This is handled in the Detailed Build Instructions section of the reference documentation. If you have installed an SDK package then you will find pre-built binaries for an embedded device in specific sub-directories, for instance /opt/Qtopia/SDK/<version>/greenphone. In an SDK package these binaries cannot be rebuilt. For a Qt Extended source package the binaries can be built in any configuration required.

If you only want to run Qt Extended on your desktop machine at this time, then the device-specific binaries are irrelevant. If you do want to run Qt Extended on a device then it is assumed that the binaries for that specific type of device are available.

If this is your first encounter with Qt Extended and/or cross-compiling then it might be best to start with experimenting on the desktop and when you are comfortable with that, start running Qt Extended on a device.

Prefix vs Image

Qt Extended installs into the image directory but it expects to be run from the prefix directory. If you are unfamiliar with how these locations are handled, please see Image, prefix and SDK location.

If you are building against the Greenphone SDK, the image is located at /opt/Qtopia/SDK/<version>/<device>/image. Note that device is either x86 or greenphone.

If the prefix is not the same as the image, you will need to move your files before you can run them. Qt Extended cannot run from a directory other than the prefix.

Environment Settings to Run Qt Extended

There are no specific environment variables required to run Qt Extended, however there are some that can be set to control the Qt Extended feature set.

If you specified -no-rpath you will need to set LD_LIBRARY_PATH so that the libraries can be found.

Qt Extended does not require PATH to be set but third party applications may expect it to include <prefix>/bin.

You may wish to set some environment variables to configure Qt for Embedded Linux. You may also need to set QTOPIA_PHONE_DEVICE. See Qt Extended Environment Variables for details on how to set environment variables.

Running Qt Extended on the Desktop Machine

To run Qt Extended on the desktop a runqtopia script is provided. The exact location of the script depends on the package:

packagelocation
SDK package/opt/Qtopia/SDK/scripts/runqtopia
Source package<qtextended-root-dir>/bin/runqtopia

where <qtextended-root-dir> is the install location of the source package.

The runqtopia script is designed to ease the burden of running multiple Qt Extended versions on a single machine. It launches QVFb and ensures that Qt Extended can talk to it by setting QWS_DISPLAY. It also changes the value of HOME since running multiple Qt Extended versions with the same HOME directory can cause problems.

To quit Qt Extended and close all Qt Extended applications close the virtual framebuffer.

QVFb is run using a skin to make it feel more like a real device. A skin is simply a set of XML files that define the look and feel of QVFb. You may use a different skin, or create your own to replicate your target device. If you are not familiar with QVFb please refer to: Qt Extended QVFb before continuing.

In practice the runqtopia script can be used in all cases to conveniently start Qt Extended. In cases where the script does not perform as expected, it is is advisable to take the script as the starting point and modify the procedure to meet your specific requirements.

For further information and a description of environment variables used by the script, use the command:

    runqtopia -help

For your convenience the options are reproduced here.

Note:

  • The $LANG environment variable must end in .utf8 as only UTF8 locales are supported.
  • To connect to a modem device instead of the simulator, modify the QTOPIA_PHONE_DEVICE variable and DO NOT start phonesim. If the runqtopia script is used, it will automatically skip the phone simulator unless this variable is set to sim:localhost. This subject is discussed in more detail in one of the next sections.

Running Qt Extended on an Embedded Device

This section describes the procedure to run Qt Extended on a device and is the same for all Qt Extended builds.

Note: The $QWS_DISPLAY environment variable must specify a value for mmWidth and mmHeight so that the screen DPI can be correctly calculated.

Qt Extended can made available into the device in the following ways:

Using an NFS Mount Partition

This section describes how to run Qt Extended on a device using an NFS mount partition.

To use an NFS mount partition your device requires a network connection with the desktop machine and accesses Qt Extended binaries on the desktop machine. The binaries must be cross-compiled for the device-type (e.g. ARM) and you control the start/stop of Qt Extended through a terminal connection to the device.

This approach is ideal for some debugging and testing on a real device. The binaries can be quickly modified and re-built and the application under test can be restarted almost instantly. It provides an efficient work process when compared with the delays introduced by building packages and the usually very slow upload and flash process required to run Qt Extended from a standalone device. Performance debugging should not be made using this technique, as the lag in network operations will hinder performace.

Step 1: Setting up the Device

To setup the device, use command line tools (or whatever is available on the device) to setup the network configuration and use ifconfig to determine the IP address. Note: Network settings in Qt Extended can be used, however, you would need to exit that Qt Extended in order to run over the network.

Step 2: Exporting the Qt Extended Image Directory to the Device

To export the Qt Extended image directory to the device, execute the following commands on the desktop machine:

  1. First verify that NFS is running:
         ps aux | grep nfs

    Output will be something like this:

        tester@desk:~> ps aux | grep nfs
        root     10661  0.0  0.0     0    0 ?        SW   16:20   0:00 [nfsd]
        root     10662  0.0  0.0     0    0 ?        SW   16:20   0:00 [nfsd]
        tester     10554  0.0  0.1  3540  564 pts/8    S    16:12   0:00 grep nfs

    If you only get the bottom line, then NFS is NOT running and needs to be started.

    To start NFS use /etc/init.d/nfsserver start (or similar command) as root.

  2. indicate to NFS to export a directory by editing the /etc/exports file (as root) and adding the following line:
             /path/to/image/ *(ro)

    This exports the /path/to/image directory (and all subdirectories), and gives read-only access from any computer. In this procedure it is assumed this is the directory you want to export.

  3. indicate to NFS (again as root) that the configuration has changed using:
             exportfs -a

    The Qt Extended binaries in /path/to/image/Qtopia/bin are now accessible from the network.

Step 3: Connecting to the Device

  1. login to the connected device via telnet or ssh (using the IP address displayed in the current tab)
  2. enter your password as root and create the directory on the device that links to the desktop file system using the following command:
             mkdir -p /opt/Qtopia
  3. mount/assign the file system to the device by mounting the created folder using the following command:
            mount hostip:<path to Qt Extended image> -orsize=8192,wsize=8192,ro,nolock,tcp /opt/Qtopia
  4. You should now be able to fill <path to Qt Extended image> on your desktop machine (named hostip) with files that are accessible from the device.

Using a Binary Flashed onto the Device

This is the ultimate goal and is mentioned here for completeness. However, this option is device specific and not within the scope of this introduction.

As a general rule Qt Extended (or any other application) can be flashed onto a device using a CF or SD card or can be uploaded onto the device using a serial connection. Usually this means the image (for example, <path to Qt Extended image>) must first be packed into a special file such as initrd.bin. This file is uploaded and flashed into the device flash memory. The correct procedure is entirely dependent on the device used and cannot be described here. Please refer to the device manufacturers documentation for details of installing to the device.

Once the software is installed on the device the general rule is to reboot the device and the Linux boot script will ensure that Qt Extended is started automatically. If this doesn't work it is a system integration task to modify the relevant boot scripts.

From a Qt Extended perspective, running Qt Extended on a device means: power on the device and off you go!

For more information about system integration refer to System Customization.

Touchscreen Phone Calibration

When building Qt Extended for a touchscreen device, the touchscreen must be calibrated manually as Calibration is not run automatically. With Qt Extended running, enter the following command to start calibration:

          qcop service send Launcher "execute(QString)" "calibrate"

This outputs calibration information to the /etc/pointercal file.

See also: System Customization.

Connecting Qt Extended to the Phone Device

Qt Extended provides the GUI software that runs on a mobile phone. To make a real phone call the electronics need to connect to a phone network. These electronics are assumed to be in the phone device itself. This section describes how the Qt Extended Phone software can be connected to the phone device hardware.

Using a Phone Simulator

The phone simulator is an internal tool used to test part of the Qt Extended Phone functionality. It simulates part of the modem functionality and is the first step in debugging software. The simulator has been included in the package because it is well suited to illustrating the capabilities of Qt Extended. Please be advised however that the phone simulator is an unsupported tool.

Connect Qt Extended to the simulator using the following command:

         export QTOPIA_PHONE_DEVICE=sim:localhost

This must be set before either Qt Extended or the simulator are started. If the runqtopia script is used, the default value for the environment variable QTOPIA_PHONE_DEVICE is sim:localhost. It is possible to run Qt Extended on one machine (embedded device) and the phone simulator on another machine. To do this replace localhost with the name of the machine on which the phonesim is running.

Note: The phone simulator can be build for either the development host or the target.

Further phone simulator information is available in the Tools section of the reference documentation.

Using a Phone Device

Qt Extended can be connected to a real phone device using a serial connection. Please be advised that the phone device must support the standard AT commands. To connect use the following command:

         export QTOPIA_PHONE_DEVICE=/dev/ttyS1:115200
         export QTOPIA_PHONE_VENDOR=wavecom

where:

  • ttyS1 = the serial port
  • 115200 = the baud rate
  • wavecom = the name of the modem plugin to use

When using Qt Extended connect to a modem the environment variables QTOPIA_PHONE_DEVICE and QTOPIA_PHONE_VENDOR must be set before Qt Extended is started. Entering a baud rate after the serial port name is optional and depends on the modem being used. It is not necessary to start the phonesim application.

If you wish to start Qt Extended with multiplexing disabled then use the following command before starting Qt Extended:

         export QTOPIA_PHONE_MUX=no

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  2. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  3. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  6. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 51
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 229
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
  7. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
Page suivante

Le Qt Labs au hasard

Logo

Le moteur de rendu OpenGL

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web