The Virtual FramebufferQt for Embedded Linux applications write directly to the framebuffer, eliminating the need for the X Window System and saving memory. For development and debugging purposes, a virtual framebuffer can be used, allowing Qt for Embedded Linux programs to be developed on a desktop machine, without switching between consoles and X11. QVFb is an X11 application supplied with Qt for X11 that provides a virtual framebuffer for Qt for Embedded Linux to use. To use it, you need to configure and install Qt for X11 platforms appropriately. Further requirements can be found in the Qt for Embedded Linux Requirements document. The virtual framebuffer emulates a framebuffer using a shared memory region and the qvfb tool to display the framebuffer in a window. The qvfb tool also supports a feature known as a skin which can be used to change the look and feel of the display. The tool is located in Qt's tools/qvfb directory, and provides several additional features accessible through its File and View menus. Please note that the virtual framebuffer is a development tool only. No security issues have been considered in the virtual framebuffer design. It should be avoided in a production environment; i.e. do not configure production libraries with the -qvfb option. Displaying the Virtual FramebufferTo run the qvfb tool displaying the virtual framebuffer, the Qt for Embedded Linux library must be configured and compiled with the -qvfb option: cd path/to/QtEmbedded ./configure -qvfb make Ensure that you have all the necessary libraries needed to build the tool, then compile and run the qvfb tool as a normal Qt for X11 application (i.e., do not compile it as a Qt for Embedded Linux application): cd path/to/Qt/tools/qvfb make ./qvfb The qvfb application supports the following command line options:
SkinsA skin is a set of XML and pixmap files that tells the vitual framebuffer what it should look like and how it should behave; a skin can change the unrealistic default display into a display that is similar to the target device. To access the qvfb tool's menus when a skin is activated, right-click over the display. Note that a skin can have buttons which (when clicked) send signals to the Qt Extended application running inside the virtual framebuffer, just as would happen on a real device.
Creating Custom Skins The XML and pixmap files specifying a custom skin must be located in subdirectory of the Qt's /tools/qvfb directory, called /customskin.skin. See the ClamshellPhone skin for an example of the file structure: cd path/to/Qt/tools/qvfb/ClamshellPhone.skin/ The /ClamshellPhone.skin directory contains the following files:
Note that the defaultbuttons.conf file is only necessary if the skin is supposed to be used with Qt Extended (The file customizes the launch screen applications, orders the soft keys and provides input method hints). See the Qt Extended documentation for more information.
The File MenuThe File menu allows the user to configure the virtual framebuffer display (File|Configure...), save a snapshot of the framebuffer contents (File|Save Image...) and record the movements in the framebuffer (File|Animation...). When choosing the File|Configure menu item, the qvfb tool provides a configuration dialog allowing the user to customize the display of the virtual framebuffer. The user can modify the size and depth as well as the Gamma values, and also select the preferred skin (i.e. making the virtual framebuffer simulate the target device environment). In addition, it is possible to emulate a touch screen and a LCD screen. Note that when configuring (except when changing the Gamma values only), any applications using the virtual framebuffer will be terminated. The View MenuThe View menu allows the user to modify the target's refresh rate (View|Refresh Rate...), making qvfb check for updated regions more or less frequently. The regions of the display that have changed are updated periodically, i.e. the virtual framebuffer is displaying discrete snapshots of the framebuffer rather than each individual drawing operation. For this reason drawing problems such as flickering may not be apparent until the program is run using a real framebuffer. If little drawing is being done, the framebuffer will not show any updates between drawing events. If an application is displaying an animation, the updates will be frequent, and the application and qvfb will compete for processor time. The View menu also allows the user to zoom the view of the application (View|Zoom *). Running Applications Using the Virtual FramebufferOnce the virtual framebuffer (the qvfb application) is running, it is ready for use: Start a server application (i.e. construct a QApplication object with the QApplication::GuiServer flag or use the -qws command line parameter. See the running applications documentation for details). For example: cd path/to/QtEmbedded/examples/widgets/analogclock make ./analogclock -qws Note that as long as the virtual framebuffer is running and the current Qt for Embedded Linux configuration supports qvfb, Qt for Embedded Linux will automatically detect it and use it by default. Alternatively, the -display option can be used to specify the virtual framebuffer driver. For example: cd path/to/QtEmbedded/examples/widgets/analogclock make ./analogclock -qws -display QVFb:0 Warning: If qvfb is not running (or the current Qt for Embedded Linux configuration doesn't support it) and the driver is not explicitly specified, Qt for Embedded Linux will write to the real framebuffer and the X11 display will be corrupted. |
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.8 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com