1QPaintDevice(3qt)                                            QPaintDevice(3qt)
2
3
4

NAME

6       QPaintDevice - The base class of objects that can be painted
7

SYNOPSIS

9       #include <qpaintdevice.h>
10
11       Inherited by QWidget, QPixmap, QPicture, and QPrinter.
12
13   Public Members
14       virtual ~QPaintDevice ()
15       bool isExtDev () const
16       bool paintingActive () const
17       virtual HDC handle () const
18       virtual Qt::HANDLE handle () const
19       Display * x11Display () const
20       int x11Screen () const
21       int x11Depth () const
22       int x11Cells () const
23       Qt::HANDLE x11Colormap () const
24       bool x11DefaultColormap () const
25       void * x11Visual () const
26       bool x11DefaultVisual () const
27
28   Static Public Members
29       Display * x11AppDisplay ()
30       int x11AppScreen ()
31       int x11AppDpiX ()
32       int x11AppDpiY ()
33       void x11SetAppDpiX ( int dpi )
34       void x11SetAppDpiY ( int dpi )
35       int x11AppDepth ()
36       int x11AppCells ()
37       Qt::HANDLE x11AppRootWindow ()
38       Qt::HANDLE x11AppColormap ()
39       bool x11AppDefaultColormap ()
40       void * x11AppVisual ()
41       bool x11AppDefaultVisual ()
42       int x11AppDepth ( int screen )
43       int x11AppCells ( int screen )
44       Qt::HANDLE x11AppRootWindow ( int screen )
45       Qt::HANDLE x11AppColormap ( int screen )
46       void * x11AppVisual ( int screen )
47       bool x11AppDefaultColormap ( int screen )
48       bool x11AppDefaultVisual ( int screen )
49       int x11AppDpiX ( int screen )
50       int x11AppDpiY ( int screen )
51       void x11SetAppDpiX ( int dpi, int screen )
52       void x11SetAppDpiY ( int dpi, int screen )
53
54   Protected Members
55       QPaintDevice ( uint devflags )
56       virtual bool cmd ( int, QPainter *, QPDevCmdParam * )
57
59       void bitBlt ( QPaintDevice * dst, int dx, int dy, const QPaintDevice *
60           src, int sx, int sy, int sw, int sh, Qt::RasterOp rop, bool
61           ignoreMask )
62       void bitBlt ( QPaintDevice * dst, const QPoint & dp, const QPaintDevice
63           * src, const QRect & sr, RasterOp rop )
64

DESCRIPTION

66       The QPaintDevice class is the base class of objects that can be
67       painted.
68
69       A paint device is an abstraction of a two-dimensional space that can be
70       drawn using a QPainter. The drawing capabilities are implemented by the
71       subclasses QWidget, QPixmap, QPicture and QPrinter.
72
73       The default coordinate system of a paint device has its origin located
74       at the top-left position. X increases to the right and Y increases
75       downward. The unit is one pixel. There are several ways to set up a
76       user-defined coordinate system using the painter, for example, using
77       QPainter::setWorldMatrix().
78
79       Example (draw on a paint device):
80
81           void MyWidget::paintEvent( QPaintEvent * )
82           {
83               QPainter p;                       // our painter
84               p.begin( this );                  // start painting the widget
85               p.setPen( red );                  // red outline
86               p.setBrush( yellow );             // yellow fill
87               p.drawEllipse( 10, 20, 100,100 ); // 100x100 ellipse at position (10, 20)
88               p.end();                          // painting done
89           }
90
91       The bit block transfer is an extremely useful operation for copying
92       pixels from one paint device to another (or to itself). It is
93       implemented as the global function bitBlt().
94
95       Example (scroll widget contents 10 pixels to the right):
96
97           bitBlt( myWidget, 10, 0, myWidget );
98
99       Warning: Qt requires that a QApplication object exists before any paint
100       devices can be created. Paint devices access window system resources,
101       and these resources are not initialized before an application object is
102       created.
103
104       See also Graphics Classes and Image Processing Classes.
105

MEMBER FUNCTION DOCUMENTATION

QPaintDevice::QPaintDevice ( uint devflags ) [protected]

108       Constructs a paint device with internal flags devflags. This
109       constructor can be invoked only from QPaintDevice subclasses.
110

QPaintDevice::~QPaintDevice () [virtual]

112       Destroys the paint device and frees window system resources.
113

bool QPaintDevice::cmd ( int, QPainter *, QPDevCmdParam * ) [virtual

115       protected]
116       Internal virtual function that interprets drawing commands from the
117       painter.
118
119       Implemented by subclasses that have no direct support for drawing
120       graphics (external paint devices, for example, QPicture).
121

Qt::HANDLE QPaintDevice::handle () const [virtual]

123       Returns the window system handle of the paint device, for low-level
124       access. Using this function is not portable.
125
126       The HANDLE type varies with platform; see qpaintdevice.h and
127       qwindowdefs.h for details.
128
129       See also x11Display().
130

bool QPaintDevice::isExtDev () const

132       Returns TRUE if the device is an external paint device; otherwise
133       returns FALSE.
134
135       External paint devices cannot be bitBlt()'ed from. QPicture and
136       QPrinter are external paint devices.
137

bool QPaintDevice::paintingActive () const

139       Returns TRUE if the device is being painted, i.e. someone has called
140       QPainter::begin() but not yet called QPainter::end() for this device;
141       otherwise returns FALSE.
142
143       See also QPainter::isActive().
144

int QPaintDevice::x11AppCells () [static]

146       Returns the number of entries in the colormap for the default screen of
147       the X display global to the application (X11 only). Using this function
148       is not portable.
149
150       See also x11Colormap().
151

int QPaintDevice::x11AppCells ( int screen ) [static]

153       This is an overloaded member function, provided for convenience. It
154       behaves essentially like the above function.
155
156       Returns the number of entries in the colormap for screen screen of the
157       X display global to the application (X11 only). Using this function is
158       not portable.
159
160       See also x11Colormap().
161

Qt::HANDLE QPaintDevice::x11AppColormap () [static]

163       Returns the colormap for the default screen of the X display global to
164       the application (X11 only). Using this function is not portable.
165
166       See also x11Cells().
167

Qt::HANDLE QPaintDevice::x11AppColormap ( int screen ) [static]

169       This is an overloaded member function, provided for convenience. It
170       behaves essentially like the above function.
171
172       Returns the colormap for screen screen of the X display global to the
173       application (X11 only). Using this function is not portable.
174
175       See also x11Cells().
176

bool QPaintDevice::x11AppDefaultColormap () [static]

178       Returns the default colormap for the default screen of the X display
179       global to the application (X11 only). Using this function is not
180       portable.
181
182       See also x11Cells().
183

bool QPaintDevice::x11AppDefaultColormap ( int screen ) [static]

185       This is an overloaded member function, provided for convenience. It
186       behaves essentially like the above function.
187
188       Returns the default colormap for screen screen of the X display global
189       to the application (X11 only). Using this function is not portable.
190
191       See also x11Cells().
192

bool QPaintDevice::x11AppDefaultVisual () [static]

194       Returns TRUE if the Visual used is the default for the default screen
195       of the X display global to the application (X11 only); otherwise
196       returns FALSE. Using this function is not portable.
197

bool QPaintDevice::x11AppDefaultVisual ( int screen ) [static]

199       This is an overloaded member function, provided for convenience. It
200       behaves essentially like the above function.
201
202       Returns TRUE if the Visual used is the default for screen screen of the
203       X display global to the application (X11 only); otherwise returns
204       FALSE. Using this function is not portable.
205

int QPaintDevice::x11AppDepth ( int screen ) [static]

207       Returns the depth for screen screen of the X display global to the
208       application (X11 only). Using this function is not portable.
209
210       See also QPixmap::defaultDepth().
211

int QPaintDevice::x11AppDepth () [static]

213       This is an overloaded member function, provided for convenience. It
214       behaves essentially like the above function.
215
216       Returns the depth for the default screen of the X display global to the
217       application (X11 only). Using this function is not portable.
218
219       See also QPixmap::defaultDepth().
220

Display * QPaintDevice::x11AppDisplay () [static]

222       Returns a pointer to the X display global to the application (X11
223       only). Using this function is not portable.
224
225       See also handle().
226

int QPaintDevice::x11AppDpiX ( int screen ) [static]

228       Returns the horizontal DPI of the X display (X11 only) for screen
229       screen. Using this function is not portable. See QPaintDeviceMetrics
230       for portable access to related information. Using this function is not
231       portable.
232
233       See also x11AppDpiY(), x11SetAppDpiX(), and
234       QPaintDeviceMetrics::logicalDpiX().
235

int QPaintDevice::x11AppDpiX () [static]

237       This is an overloaded member function, provided for convenience. It
238       behaves essentially like the above function.
239
240       Returns the horizontal DPI of the X display (X11 only) for the default
241       screen. Using this function is not portable. See QPaintDeviceMetrics
242       for portable access to related information. Using this function is not
243       portable.
244

int QPaintDevice::x11AppDpiY ( int screen ) [static]

246       Returns the vertical DPI of the X11 display (X11 only) for screen
247       screen. Using this function is not portable. See QPaintDeviceMetrics
248       for portable access to related information. Using this function is not
249       portable.
250
251       See also x11AppDpiX(), x11SetAppDpiY(), and
252       QPaintDeviceMetrics::logicalDpiY().
253

int QPaintDevice::x11AppDpiY () [static]

255       This is an overloaded member function, provided for convenience. It
256       behaves essentially like the above function.
257
258       Returns the vertical DPI of the X11 display (X11 only) for the default
259       screen. Using this function is not portable. See QPaintDeviceMetrics
260       for portable access to related information. Using this function is not
261       portable.
262
263       See also x11AppDpiX(), x11SetAppDpiY(), and
264       QPaintDeviceMetrics::logicalDpiY().
265

Qt::HANDLE QPaintDevice::x11AppRootWindow () [static]

267       Returns the root window for the default screen of the X display global
268       to the applicatoin (X11 only). Using this function is not portable.
269

Qt::HANDLE QPaintDevice::x11AppRootWindow ( int screen ) [static]

271       This is an overloaded member function, provided for convenience. It
272       behaves essentially like the above function.
273
274       Returns the root window for screen screen of the X display global to
275       the applicatoin (X11 only). Using this function is not portable.
276

int QPaintDevice::x11AppScreen () [static]

278       Returns the screen number on the X display global to the application
279       (X11 only). Using this function is not portable.
280

void * QPaintDevice::x11AppVisual () [static]

282       Returns the Visual for the default screen of the X display global to
283       the application (X11 only). Using this function is not portable.
284

void * QPaintDevice::x11AppVisual ( int screen ) [static]

286       This is an overloaded member function, provided for convenience. It
287       behaves essentially like the above function.
288
289       Returns the Visual for screen screen of the X display global to the
290       application (X11 only). Using this function is not portable.
291

int QPaintDevice::x11Cells () const

293       Returns the number of entries in the colormap of the X display for the
294       paint device (X11 only). Using this function is not portable.
295
296       See also x11Colormap().
297

Qt::HANDLE QPaintDevice::x11Colormap () const

299       Returns the colormap of the X display for the paint device (X11 only).
300       Using this function is not portable.
301
302       See also x11Cells().
303

bool QPaintDevice::x11DefaultColormap () const

305       Returns the default colormap of the X display for the paint device (X11
306       only). Using this function is not portable.
307
308       See also x11Cells().
309

bool QPaintDevice::x11DefaultVisual () const

311       Returns the default Visual of the X display for the paint device (X11
312       only). Using this function is not portable.
313

int QPaintDevice::x11Depth () const

315       Returns the depth of the X display for the paint device (X11 only).
316       Using this function is not portable.
317
318       See also QPixmap::defaultDepth().
319

Display * QPaintDevice::x11Display () const

321       Returns a pointer to the X display for the paint device (X11 only).
322       Using this function is not portable.
323
324       See also handle().
325

int QPaintDevice::x11Screen () const

327       Returns the screen number on the X display for the paint device (X11
328       only). Using this function is not portable.
329

void QPaintDevice::x11SetAppDpiX ( int dpi, int screen ) [static]

331       Sets the value returned by x11AppDpiX() to dpi for screen screen. The
332       default is determined by the display configuration. Changing this value
333       will alter the scaling of fonts and many other metrics and is not
334       recommended. Using this function is not portable.
335
336       See also x11SetAppDpiY().
337

void QPaintDevice::x11SetAppDpiX ( int dpi ) [static]

339       This is an overloaded member function, provided for convenience. It
340       behaves essentially like the above function.
341
342       Sets the value returned by x11AppDpiX() to dpi for the default screen.
343       The default is determined by the display configuration. Changing this
344       value will alter the scaling of fonts and many other metrics and is not
345       recommended. Using this function is not portable.
346

void QPaintDevice::x11SetAppDpiY ( int dpi, int screen ) [static]

348       Sets the value returned by x11AppDpiY() to dpi for screen screen. The
349       default is determined by the display configuration. Changing this value
350       will alter the scaling of fonts and many other metrics and is not
351       recommended. Using this function is not portable.
352
353       See also x11SetAppDpiX().
354

void QPaintDevice::x11SetAppDpiY ( int dpi ) [static]

356       This is an overloaded member function, provided for convenience. It
357       behaves essentially like the above function.
358
359       Sets the value returned by x11AppDpiY() to dpi for the default screen.
360       The default is determined by the display configuration. Changing this
361       value will alter the scaling of fonts and many other metrics and is not
362       recommended. Using this function is not portable.
363

void * QPaintDevice::x11Visual () const

365       Returns the Visual of the X display for the paint device (X11 only).
366       Using this function is not portable.
367

void bitBlt ( QPaintDevice * dst, int dx, int dy, const QPaintDevice * src,

370       int sx, int sy, int sw, int sh, Qt::RasterOp rop, bool ignoreMask )
371       Copies a block of pixels from src to dst, perhaps merging each pixel
372       according to the raster operation rop. sx, sy is the top-left pixel in
373       src (0, 0) by default, dx, dy is the top-left position in dst and sw,
374       sh is the size of the copied block (all of src by default).
375
376       The most common values for rop are CopyROP and XorROP; the Qt::RasterOp
377       documentation defines all the possible values.
378
379       If ignoreMask is FALSE (the default) and src is a masked QPixmap, the
380       entire blit is masked by src->mask().
381
382       If src, dst, sw or sh is 0, bitBlt() does nothing. If sw or sh is
383       negative bitBlt() copies starting at sx (and respectively, sy) and
384       ending at the right end (respectively, bottom) of src.
385
386       src must be a QWidget or QPixmap. You cannot blit from a QPrinter, for
387       example. bitBlt() does nothing if you attempt to blit from an
388       unsupported device.
389
390       bitBlt() does nothing if src has a greater depth than dst. If you need
391       to for example, draw a 24-bit pixmap on an 8-bit widget, you must use
392       drawPixmap().
393

void bitBlt ( QPaintDevice * dst, const QPoint & dp, const QPaintDevice * src,

395       const QRect & sr, RasterOp rop )
396       This is an overloaded member function, provided for convenience. It
397       behaves essentially like the above function.
398
399       Overloaded bitBlt() with the destination point dp and source rectangle
400       sr.
401
402

SEE ALSO

404       http://doc.trolltech.com/qpaintdevice.html
405       http://www.trolltech.com/faq/tech.html
406
408       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
409       license file included in the distribution for a complete license
410       statement.
411

AUTHOR

413       Generated automatically from the source code.
414

BUGS

416       If you find a bug in Qt, please report it as described in
417       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
418       help you. Thank you.
419
420       The definitive Qt documentation is provided in HTML format; it is
421       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
422       web browser. This man page is provided as a convenience for those users
423       who prefer man pages, although this format is not officially supported
424       by Trolltech.
425
426       If you find errors in this manual page, please report them to qt-
427       bugs@trolltech.com.  Please include the name of the manual page
428       (qpaintdevice.3qt) and the Qt version (3.3.8).
429
430
431
432Trolltech AS                    2 February 2007              QPaintDevice(3qt)
Impressum