Qt:Документация 4.3.2/qtopiacore-displaymanagement

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

[править] Qtopia Core Display Management

When rendering, Qtopia Core's default behavior is for each client to render its widgets into memory while the server is responsible for putting the contents of the memory onto the screen. The server uses the screen driver to copy the content of the memory to the display.

The screen driver is loaded by the server application when it starts running, using Qt's plugin system.

Содержание:

[править] Available Drivers

Qtopia Core provides drivers for the Linux framebuffer, the virtual framebuffer, transformed screens, VNC servers and multi screens. Run the configure script to list the available drivers:

 ./configure -help

In the default Qt configuration, only an unaccelerated Linux framebuffer driver (/dev/fb0) is enabled. The various drivers can be enabled and disabled using the configure script. Пример:

 ./configure -qt-gfx-transformed

Custom screen drivers can be implemented by subclassing the QScreen class and creating a screen driver plugin (derived from the QScreenDriverPlugin class). Qtopia Core's implementation of the QScreenDriverFactory class will automatically detect the plugin, loading the driver into the server application at runtime.

[править] Specifying a Driver

To specify which driver to use, set the QWS_DISPLAY environment variable. For example (if the current shell is bash, ksh, zsh or sh):

 export QWS_DISPLAY="<driver>[:<driver specific options>]...
          [:<display num>]"

The valid values for the <driver> argument are LinuxFb, QVFb, VNC, Transformed, Multi and keys identifying custom drivers, and the <display num> argument is used to separate screens that are using the same screen driver and to enable multiple displays (see the Running Qtopia Core Applications documentation for more details). The driver specific options are described in the table below.


Driver Specific Option Available For Описание
tty=<device> LinuxFb Passes the device file to the console the application is running on.
nographicsmodeswitch LinuxFb Ensures that the application is not in graphics mode.
mmWidth=<value>
LinuxFb, QVFb The screen's physical width (used to calculate DPI).
mmHeight=<value>
LinuxFb, QVFb The screen's physical height (used to calculate DPI).
<device> LinuxFb
<subdriver> VNC, Transformed, Multi Specifies a subdriver.
<RotX> Transformed Specifies the rotation of the screen. The valid values of X are 90, 180 and 270.
offset=<x,y> Multi Specifies the coordinates of a subscreens top-left corner (by default 0,0).

The QWS_DISPLAY environment variable can also be set using the -display option when running an application. Пример:

 myApplication -display "<driver>[:<driver specific options>]...
          [:<display num>]"
Subdrivers
The VNC, Transformed and Multi screen drivers depend on subdrivers. The general syntax for specifying a driver is as follows:
 export QWS_DISPLAY="<driver>[:<subdriver>][:<subdriver options>]...
         [ :<display num>]"

In the case of subdrivers, it is important to add a space between each subdriver and before the display number to separate the various drivers and displays. Note that Multi screen drivers can have several subdrivers. Пример:

 export QWS_DISPLAY="Multi: QVFb:0 QVFb:offset=640,0:1 :2"

Note also that the VNC screen driver defaults to a virtual screen driver if no subdriver is specified. In this case the VNC driver accepts a few additional (optional) arguments specifying the size and depth of the default virtual screen:

  • size=<width x height>
  • depth=<value>
  • mmHeight=<physical height in millimeters>
  • mmWidth=<physical width in millimeters>

Example running the VNC screen driver with a virtual screen of size 720x480 with 32 bits per pixel:

 export QWS_DISPLAY="VNC:size=720x480:depth=32"

Example running the VNC screen driver on top of the Linux framebuffer driver:

 export QWS_DISPLAY="VNC:LinuxFb"



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2