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  ·  Modules  ·  Fonctions  · 

Running Qtopia Core Applications

A Qtopia Core application requires a server application to be running, or to be the server application itself. Any Qtopia Core application can be the server application by constructing the QApplication object with the QApplication::GuiServer type, or by running the application with the -qws command line option.

Applications can run using both single and multiple displays, and various command line options are available.

Note that this document assumes that you either are using the Qtopia Core's Virtual Framebuffer or that you are running Qtopia Core using the VNC protocol, or that you have the Linux framebuffer configured correctly and that no server process is running. (To test that the Linux framebuffer is set up correctly, use the program provided by the Testing the Linux Framebuffer document.)

Using a Single Display

To run the application using a single display, change to a Linux console and select an application to run, e.g. demos/textedit. Run the application with the -qws option:

 cd path/to/Qtopia/Core/demos/textedit
 ./textedit -qws

Provided that the environment variables are adjusted properly during the installation process, you should see the Text Edit demo appear.

It might be that the hardware drivers must be specified explicitly to make everything work properly. For more information, please consult the following documentation:

Additional applications can be run as clients, i.e., by running these applications without the -qws option they will connect to the existing server as clients. You can exit the server application at any time using Ctrl+Alt+Backspace.

Using Multiple Displays

Qtopia Core also allows multiple displays to be used simultaneously. There are two ways of achieving this: Either run multiple Qtopia Core server processes, or use Qtopia Core's ready-made Multi screen driver.

When running multiple server processes, the screen driver (and display number) must be specified for each process using the -display command line option or by setting the QWS_DISPLAY environment variable. For example:

 ./myfirstserverapplication -qws -display "transformed:rot90:1"
 ./mysecondserverapplication -qws -display "QVFb:2"

See the display management documentation for more details on how to specify a screen driver. Note that you must also specify the display (i.e., server process) when starting client applications:

 ./myclientapplication -display "QVFb:2"

There is no way of moving a client from one display to another when running multiple server processes. Using the Multi screen driver, on the other hand, applications can easiliy be moved between the various screens.

The Multi screen driver can be specified just like any other screen driver by using the -display command line option or by setting the QWS_DISPLAY environment variable. For example:

 ./myserverapplication -qws -display "Multi: QVFb:0
         QVFb:1:offset=0,0 VNC:offset=640,0 :2"

See the display management documentation for details regarding arguments.

Command Line Options

OptionDescription
-fn <font>Defines the application font. For example:
 ./myapplication -fn helvetica

The font should be specified using an X logical font description.

-bg <color>Sets the default application background color. For example:
 ./myapplication -bg blue

The color-name must be one of the names recognized by the QColor constructor.

-btn <color>Sets the default button color. For example:
 ./myapplication -btn green

The color-name must be one of the names recognized by the QColor constructor.

-fg <color>Sets the default application foreground color. For example:
 ./myapplication -fg 'dark blue'

The color-name must be one of the names recognized by the QColor constructor.

-name <objectname>Sets the application name, i.e. the application object's object name. For example:
 ./myapplication -name texteditapplication
-title <title>Sets the application's title. For example:
 ./myapplication -title 'Text Edit'
-geometry <width>x<height>x<Xoffset>x<YOffset>Sets the client geometry of the first window that is shown. For example:
 ./myapplication -geometry 300x200x50x50
-keyboardEnables the keyboard.

See also: Qtopia Core Character Input.

-nokeyboardDisables the keyboard.
-mouseEnables the mouse cursor.

See also: Qtopia Core Pointer Handling.

-nomouseDisables the mouse cursor.
-qwsRuns the application as a server application, i.e. constructs a QApplication object of the QApplication::GuiServer type.
-displaySpecifies the screen driver.

See also: Qtopia Core Display Management.

-decoration <style>Sets the application decoration. For example:
 ./myapplication -decoration windows

The supported styles are windows, default and styled.

See also QDecoration.

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 59
  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 Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Construire l'avenir : (ré-)introduction aux composants de Qt Quick

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 4.2
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