Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQt/Embedded Virtual Framebuffer

The virtual framebuffer allows TQt/Embedded programs to be developed on a desktop machine, without switching between consoles and X11.

The virtual framebuffer is located in `$TQTDIR/tools/tqvfb`.

## Using the Virtual Framebuffer

1. Configure TQt/Embedded with the `-tqvfb` argument and compile the library:

           ./configure -tqvfb
           make

2. Compile `tqvfb` as a normal TQt/X11 application and run it. Do not compile it as a TQt/Embedded application.
3. Start a TQt/Embedded master application (i.e., construct TQApplication with the TQApplication::GuiServer flag or use the `-qws` command line parameter). You can specify to the server that you wish to use the virtual framebuffer driver, e.g.:

           masterapp -qws -display TQVFb:0

4. TQt/Embedded will autodetect tqvfb, so you can omit the `-display` command line parameter if you know that tqvfb is running, and that the TQt/Embedded library supports tqvfb. (If this is not the case, TQt/Embedded will write to the real framebuffer, and your X11 display will be corrupted.)

`tqvfb` supports the following command line options:

Option | Meaning
--- | ---
`-width` width | the width of the virtual framebuffer (default: 240).
`-height` height | the height of the virtual framebuffer (default: 320).
`-depth` depth | the depth of the virtual framebuffer (1, 8 or 32; default: 8).
`-nocursor` | do not display the X11 cursor in the framebuffer window.
`-qwsdisplay` :id | the TQt/Embedded display id to provide (default: :0).

## Virtual Framebuffer Design

The virtual framebuffer emulates a framebuffer using a shared memory region (the virtual frame buffer) and a utility to display the framebuffer in a window (`tqvfb`). The regions of the display that have changed are updated periodically, so you will see 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.

The target refresh rate can be set via the View|Refresh Rate menu item. This will cause `tqvfb` to check for updated regions more frequently. The rate is a target only. 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, then the application and `tqvfb` will compete for processor time.

Mouse and keyboard events are passed to the TQt/Embedded master process via named pipes.

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; do not configure production libraries with `-tqvfb`.