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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

Running Qt/Embedded applications

A Qt/Embedded application requires a master application to be running or to be a master application itself. The master application is primarily responsible for managing top-level window regions, and pointer and keyboard input.

Any Qt/Embedded application can be a master application by constructing the QApplication object with the QApplication::GuiServer type, or by being run with the -qws command line option.

This document assumes you have the Linux framebuffer configured correctly and no master process is running. If you do not have a working Linux framebuffer you can use the Qt/Embedded virtual framebuffer, or you can run Qt/Embedded as a VNC server.

Change to a Linux console and select an example to run, e.g. examples/widgets. Make sure $QTDIR is set to the directory where you installed Qt/Embedded and add the $QTDIR/lib directory to $LD_LIBRARY_PATH, e.g.:

export QTDIR=$HOME/qt-VERSION
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

Run the application with the -qws option:

cd $QTDIR/examples/widgets
./widgets -qws

You should see the widgets example appear. If your mouse doesn't work correctly you must specify the type of mouse to use. You can exit the master application at any time using Ctrl+Alt+Backspace.

If you wish to run additional applications you should run them as clients i.e. without the -qws option.

Displays

Qt/Embedded allows multiple displays to be used simultaneously by running multiple Qt/Embedded master processes. This is achieved using the -display command line parameter or the $QWS_DISPLAY environment variable.

The -display parameter's syntax is:

    [gfx driver][:driver specific options][:display number]
For example, if you want to use the mach64 driver on fb1 as display 2:
    $ ./launcher -display Mach64:/dev/fb1:2

To try this functionality you can do the following:

  1. Change to VC 1 (virtual console one) and run the launcher:

        $ cd examples/launcher
        $ ./launcher
    

  2. Switch to VC 2 and run another one:

        $ cd examples/launcher
        $ ./launcher -display :1
    

    Another launcher will be started. Start an application in this launcher.

  3. Press Ctrl+Alt+F1 - back to display 0. You can also start additional applications on a particular display by specifying the display id. Change to VC 3:

        $ cd examples/widgets
        $ ./widgets -display :1
    

    will display the widgets example on dislpay :1 (VC 2).

Only the master process needs to specify the driver/device part explicitly. The clients get the information they need from the master when they connect. So once you have a master server running using a particular driver, you can just use "client -display :n" to use display n.

Mouse Input

Qt/Embedded attempts to autodetect a mouse by default. The supported protocols are MouseMan, Microsoft, IntelliMouse and some other devices specific to certain hardware (e.g. Vr touch panel). To specify the mouse to use set the $QWS_MOUSE_PROTO environment variable, e.g.:

export QWS_MOUSE_PROTO=IntelliMouse

The mouse autodetection opens the serial devices and psaux which may cause conflicts with other programs using those devices. If this is the case then specify the mouse driver protocol and device explicitly.

See also Qt/Embedded Pointer Handling.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 68
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique PyQt/PySide a besoin de vous ! 0
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 3.3
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