Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The TQDirectPainter class provides direct access to the video hardware. More...
#include <qdirectpainter_qws.h>
Inherits TQPainter.
Only available in TQt/Embedded.
When the hardware is known and well defined, as is often the case with software for embedded devices, it may be useful to manipulate the underlying video hardware directly. In order to do this in a way that is co-operative with other applications, you must lock the video hardware for exclusive use for a small time while you write to it, and you must know the clipping region which is allocated to a widget.
TQDirectPainter provides this functionality.
In the simplest case, you make a TQDirectPainter on a widget and then, observing the clip region, perform some platform-specific operation. For example:
void MyWidget::updatePlatformGraphics() { TQDirectPainter dp( this ); for ( int i = 0; i < dp.numRects; i++ ) { const TQRect& clip = dp.rect(i); ... // platform specific operation } }
The platform-specific code has access to the display, but should only modify graphics in the rectangles specified by numRects() and rect(). Note that these rectangles are relative to the entire display.
The offset() function returns the position of the widget relative to the entire display, allowing you to offset platform-specific operations appropriately. The xOffset() and yOffset() functions merely return the component values of offset().
For simple frame-buffer hardware, the frameBuffer(), lineStep(), and depth() functions provide basic access, though some hardware configurations are insufficiently specified by such simple parameters.
Note that while a TQDirectPainter exists, the entire TQt/Embedded window system is locked from use by other applications. Always construct the TQDirectPainter as an auto (stack) variable, and be very careful to write robust and stable code within its scope.
See also Graphics Classes.
See also region().
See also numRects() and rect().
See also width() and height().
0 | no rotation |
1 | 90 degrees rotation |
2 | 180 degrees rotation |
3 | 270 degrees rotation |
This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.
Copyright © 2007 Trolltech | Trademarks | TQt 3.3.8
|