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  · 

The VNC Protocol and Qt for Embedded Linux

VNC (Virtual Network Computing) software makes it possible to view and interact with one computer (the "server") from any other computer or mobile device (the "viewer") anywhere on a network.

VNC clients are available for a vast array of display systems, including X11, Mac OS X and Windows.

Configuring Qt with VNC Capabilities

To run a Qt for Embedded Linux application using the VNC protocol, the Qt for Embedded Linux library must be configured and compiled with the -qt-gfx-vnc option:

 cd path/to/QtEmbedded
 ./configure -qt-gfx-vnc
 make

Running a Server Application

Start a server application by specifying the -qws command line option when running the application. (This can also be specified in the application's source code.) Use the -display command line option to specify the VNC server's driver and the virtual screen to use. For example:

 cd path/to/QtEmbedded/examples/widgets/analogclock
 ./analogclock -qws -display VNC:0

The application will act as a VNC server which can be accessed using an ordinary VNC client, either on the development machine or from a different machine on a network.

For example, using the X11 VNC client to view the application from the same machine:

 vncviewer localhost:0

To interact with the application from another machine on the network, run a VNC client pointing to the machine that is running the server application.

Qt for Embedded Linux will create a 640 by 480 pixel display by default. Alternatively, the QWS_SIZE environment variable can be used to set another size; e.g., QWS_SIZE=240x320.

Running Client Applications

If you want to run more than one application on the same display, you only need to start the first one as a server application, using the -qws command line option to indicate that it will manage other windows.

 analogclock -qws -display VNC:0

Subsequent client applications can be started without the -qws option, but will each require the same -display option and argument as those used for the server.

 calculator -display VNC:0
 scribble -display VNC:0
 imageviewer -display VNC:0

However, for the clients, this option will not cause a new VNC server to be started, but only indicates that their windows will appear on the virtual screen managed by the server application.

Related Resources

It is not always necessary to specify the -qws command line option when running a server application as long as the QApplication object used by the application has been constructed with the QApplication::GuiServer flag.

See the running applications documentation for more details about server and client applications.

The Virtual Framebuffer

The virtual framebuffer is an alternative technique recommended for development and debugging purposes.

The virtual framebuffer emulates a framebuffer using a shared memory region and the qvfb tool to display the framebuffer in a window.

Its use of shared memory makes the virtual framebuffer much faster and smoother than using the VNC protocol, but it does not operate over a network.

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 5.0-snapshot
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