1QDirectPainter(3qt)                                        QDirectPainter(3qt)
2
3
4

NAME

6       QDirectPainter - Direct access to the video hardware
7

SYNOPSIS

9       #include <qdirectpainter_qws.h>
10
11       Inherits QPainter.
12
13   Public Members
14       QDirectPainter ( const QWidget * w )
15       ~QDirectPainter ()
16       uchar * frameBuffer ()
17       int lineStep ()
18       int transformOrientation ()
19       int numRects () const
20       const QRect & rect ( int i ) const
21       QRegion region () const
22       int depth () const
23       int width () const
24       int height () const
25       int xOffset () const
26       int yOffset () const
27       QPoint offset () const
28       QSize size () const
29       void setAreaChanged ( const QRect & r )
30

DESCRIPTION

32       The QDirectPainter class provides direct access to the video hardware.
33
34       Only available in Qt/Embedded.
35
36       When the hardware is known and well defined, as is often the case with
37       software for embedded devices, it may be useful to manipulate the
38       underlying video hardware directly. In order to do this in a way that
39       is co-operative with other applications, you must lock the video
40       hardware for exclusive use for a small time while you write to it, and
41       you must know the clipping region which is allocated to a widget.
42
43       QDirectPainter provides this functionality.
44
45       In the simplest case, you make a QDirectPainter on a widget and then,
46       observing the clip region, perform some platform-specific operation.
47       For example:
48
49               void MyWidget::updatePlatformGraphics()
50               {
51                   QDirectPainter dp( this );
52                   for ( int i = 0; i < dp.numRects; i++ ) {
53                       const QRect& clip = dp.rect(i);
54                       ... // platform specific operation
55                   }
56               }
57
58       The platform-specific code has access to the display, but should only
59       modify graphics in the rectangles specified by numRects() and rect().
60       Note that these rectangles are relative to the entire display.
61
62       The offset() function returns the position of the widget relative to
63       the entire display, allowing you to offset platform-specific operations
64       appropriately. The xOffset() and yOffset() functions merely return the
65       component values of offset().
66
67       For simple frame-buffer hardware, the frameBuffer(), lineStep(), and
68       depth() functions provide basic access, though some hardware
69       configurations are insufficiently specified by such simple parameters.
70
71       Note that while a QDirectPainter exists, the entire Qt/Embedded window
72       system is locked from use by other applications. Always construct the
73       QDirectPainter as an auto (stack) variable, and be very careful to
74       write robust and stable code within its scope.
75
76       See also Graphics Classes.
77

MEMBER FUNCTION DOCUMENTATION

QDirectPainter::QDirectPainter ( const QWidget * w )

80       Construct a direct painter on w. The display is locked and the mouse
81       cursor is hidden if it is above w.
82

QDirectPainter::~QDirectPainter ()

84       Destroys the direct painter. The mouse cursor is revealed if necessary
85       and the display is unlocked.
86

int QDirectPainter::depth () const

88       Returns the bit-depth of the display.
89

uchar * QDirectPainter::frameBuffer ()

91       Returns a pointer to the framebuffer memory if available.
92

int QDirectPainter::height () const

94       Returns the height of the widget drawn upon.
95

int QDirectPainter::lineStep ()

97       Returns the spacing in bytes from one framebuffer line to the next.
98

int QDirectPainter::numRects () const

100       Returns the number of rectangles in the drawable region.
101
102       See also rect() and region().
103

QPoint QDirectPainter::offset () const

105       Returns the position of the widget relative to the entire display.
106

const QRect & QDirectPainter::rect ( int i ) const

108       Returns a reference to rectangle i of the drawable region. Valid values
109       for i are 0..numRects()-1.
110
111       See also region().
112

QRegion QDirectPainter::region () const

114       Returns the region of the framebuffer which represents the exposed area
115       of the widget being painted on. Note that this may be a sub-area of the
116       clip region, because of child widgets and overlapping cousin widgets.
117
118       See also numRects() and rect().
119

void QDirectPainter::setAreaChanged ( const QRect & r )

121       Sets the area changed by the transaction to r. By default, the entire
122       widget is assumed to have changed. The area changed is only used by
123       some graphics drivers, so often calling this function for a smaller
124       area will make no difference to performance.
125

QSize QDirectPainter::size () const

127       Returns the size of the widget drawn upon.
128
129       See also width() and height().
130

int QDirectPainter::transformOrientation ()

132       Returns a number that signifies the orientation of the framebuffer.
133       <center>.nf
134
135       </center>
136

int QDirectPainter::width () const

138       Returns the width of the widget drawn upon.
139

int QDirectPainter::xOffset () const

141       Returns the X-position of the widget relative to the entire display.
142

int QDirectPainter::yOffset () const

144       Returns the Y-position of the widget relative to the entire display.
145
146

SEE ALSO

148       http://doc.trolltech.com/qdirectpainter.html
149       http://www.trolltech.com/faq/tech.html
150
152       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
153       license file included in the distribution for a complete license
154       statement.
155

AUTHOR

157       Generated automatically from the source code.
158

BUGS

160       If you find a bug in Qt, please report it as described in
161       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
162       help you. Thank you.
163
164       The definitive Qt documentation is provided in HTML format; it is
165       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
166       web browser. This man page is provided as a convenience for those users
167       who prefer man pages, although this format is not officially supported
168       by Trolltech.
169
170       If you find errors in this manual page, please report them to qt-
171       bugs@trolltech.com.  Please include the name of the manual page
172       (qdirectpainter.3qt) and the Qt version (3.3.8).
173
174
175
176Trolltech AS                    2 February 2007            QDirectPainter(3qt)
Impressum