summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqpaintdevice.3qt
blob: 67ecf00f78d1745668adbe408ee15c5e6cbbd9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
'\" t
.TH QPaintDevice 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QPaintDevice \- The base class of objects that can be painted
.SH SYNOPSIS
\fC#include <ntqpaintdevice.h>\fR
.PP
Inherited by TQWidget, QPixmap, QPicture, and QPrinter.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "virtual \fB~QPaintDevice\fR ()"
.br
.ti -1c
.BI "bool \fBisExtDev\fR () const"
.br
.ti -1c
.BI "bool \fBpaintingActive\fR () const"
.br
.ti -1c
.BI "virtual HDC \fBhandle\fR () const"
.br
.ti -1c
.BI "virtual Qt::HANDLE \fBhandle\fR () const"
.br
.ti -1c
.BI "Display * \fBx11Display\fR () const"
.br
.ti -1c
.BI "int \fBx11Screen\fR () const"
.br
.ti -1c
.BI "int \fBx11Depth\fR () const"
.br
.ti -1c
.BI "int \fBx11Cells\fR () const"
.br
.ti -1c
.BI "Qt::HANDLE \fBx11Colormap\fR () const"
.br
.ti -1c
.BI "bool \fBx11DefaultColormap\fR () const"
.br
.ti -1c
.BI "void * \fBx11Visual\fR () const"
.br
.ti -1c
.BI "bool \fBx11DefaultVisual\fR () const"
.br
.in -1c
.SS "Static Public Members"
.in +1c
.ti -1c
.BI "Display * \fBx11AppDisplay\fR ()"
.br
.ti -1c
.BI "int \fBx11AppScreen\fR ()"
.br
.ti -1c
.BI "int \fBx11AppDpiX\fR ()"
.br
.ti -1c
.BI "int \fBx11AppDpiY\fR ()"
.br
.ti -1c
.BI "void \fBx11SetAppDpiX\fR ( int dpi )"
.br
.ti -1c
.BI "void \fBx11SetAppDpiY\fR ( int dpi )"
.br
.ti -1c
.BI "int \fBx11AppDepth\fR ()"
.br
.ti -1c
.BI "int \fBx11AppCells\fR ()"
.br
.ti -1c
.BI "Qt::HANDLE \fBx11AppRootWindow\fR ()"
.br
.ti -1c
.BI "Qt::HANDLE \fBx11AppColormap\fR ()"
.br
.ti -1c
.BI "bool \fBx11AppDefaultColormap\fR ()"
.br
.ti -1c
.BI "void * \fBx11AppVisual\fR ()"
.br
.ti -1c
.BI "bool \fBx11AppDefaultVisual\fR ()"
.br
.ti -1c
.BI "int \fBx11AppDepth\fR ( int screen )"
.br
.ti -1c
.BI "int \fBx11AppCells\fR ( int screen )"
.br
.ti -1c
.BI "Qt::HANDLE \fBx11AppRootWindow\fR ( int screen )"
.br
.ti -1c
.BI "Qt::HANDLE \fBx11AppColormap\fR ( int screen )"
.br
.ti -1c
.BI "void * \fBx11AppVisual\fR ( int screen )"
.br
.ti -1c
.BI "bool \fBx11AppDefaultColormap\fR ( int screen )"
.br
.ti -1c
.BI "bool \fBx11AppDefaultVisual\fR ( int screen )"
.br
.ti -1c
.BI "int \fBx11AppDpiX\fR ( int screen )"
.br
.ti -1c
.BI "int \fBx11AppDpiY\fR ( int screen )"
.br
.ti -1c
.BI "void \fBx11SetAppDpiX\fR ( int dpi, int screen )"
.br
.ti -1c
.BI "void \fBx11SetAppDpiY\fR ( int dpi, int screen )"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "\fBQPaintDevice\fR ( uint devflags )"
.br
.ti -1c
.BI "virtual bool \fBcmd\fR ( int, QPainter *, QPDevCmdParam * )"
.br
.in -1c
.SH RELATED FUNCTION DOCUMENTATION
.in +1c
.ti -1c
.BI "void \fBbitBlt\fR ( QPaintDevice * dst, int dx, int dy, const QPaintDevice * src, int sx, int sy, int sw, int sh, Qt::RasterOp rop, bool ignoreMask )"
.br
.ti -1c
.BI "void \fBbitBlt\fR ( QPaintDevice * dst, const QPoint & dp, const QPaintDevice * src, const QRect & sr, RasterOp rop )"
.br
.in -1c
.SH DESCRIPTION
The QPaintDevice class is the base class of objects that can be painted.
.PP
A paint device is an abstraction of a two-dimensional space that can be drawn using a QPainter. The drawing capabilities are implemented by the subclasses TQWidget, QPixmap, QPicture and QPrinter.
.PP
The default coordinate system of a paint device has its origin located at the top-left position. X increases to the right and Y increases downward. The unit is one pixel. There are several ways to set up a user-defined coordinate system using the painter, for example, using QPainter::setWorldMatrix().
.PP
Example (draw on a paint device):
.PP
.nf
.br
    void MyWidget::paintEvent( QPaintEvent * )
.br
    {
.br
        QPainter p;                       // our painter
.br
        p.begin( this );                  // start painting the widget
.br
        p.setPen( red );                  // red outline
.br
        p.setBrush( yellow );             // yellow fill
.br
        p.drawEllipse( 10, 20, 100,100 ); // 100x100 ellipse at position (10, 20)
.br
        p.end();                          // painting done
.br
    }
.br
.fi
.PP
The bit block transfer is an extremely useful operation for copying pixels from one paint device to another (or to itself). It is implemented as the global function bitBlt().
.PP
Example (scroll widget contents 10 pixels to the right):
.PP
.nf
.br
    bitBlt( myWidget, 10, 0, myWidget );
.br
.fi
.PP
\fBWarning:\fR TQt requires that a QApplication object exists before any paint devices can be created. Paint devices access window system resources, and these resources are not initialized before an application object is created.
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QPaintDevice::QPaintDevice ( uint devflags )\fC [protected]\fR"
Constructs a paint device with internal flags \fIdevflags\fR. This constructor can be invoked only from QPaintDevice subclasses.
.SH "QPaintDevice::~QPaintDevice ()\fC [virtual]\fR"
Destroys the paint device and frees window system resources.
.SH "bool QPaintDevice::cmd ( int, QPainter *, QPDevCmdParam * )\fC [virtual protected]\fR"
Internal virtual function that interprets drawing commands from the painter.
.PP
Implemented by subclasses that have no direct support for drawing graphics (external paint devices, for example, QPicture).
.SH "Qt::HANDLE QPaintDevice::handle () const\fC [virtual]\fR"
Returns the window system handle of the paint device, for low-level access. Using this function is not portable.
.PP
The HANDLE type varies with platform; see ntqpaintdevice.h and ntqwindowdefs.h for details.
.PP
See also x11Display().
.SH "bool QPaintDevice::isExtDev () const"
Returns TRUE if the device is an external paint device; otherwise returns FALSE.
.PP
External paint devices cannot be bitBlt()'ed from. QPicture and QPrinter are external paint devices.
.SH "bool QPaintDevice::paintingActive () const"
Returns TRUE if the device is being painted, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns FALSE.
.PP
See also QPainter::isActive().
.SH "int QPaintDevice::x11AppCells ()\fC [static]\fR"
Returns the number of entries in the colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Colormap().
.SH "int QPaintDevice::x11AppCells ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the number of entries in the colormap for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Colormap().
.SH "Qt::HANDLE QPaintDevice::x11AppColormap ()\fC [static]\fR"
Returns the colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "Qt::HANDLE QPaintDevice::x11AppColormap ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the colormap for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "bool QPaintDevice::x11AppDefaultColormap ()\fC [static]\fR"
Returns the default colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "bool QPaintDevice::x11AppDefaultColormap ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the default colormap for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "bool QPaintDevice::x11AppDefaultVisual ()\fC [static]\fR"
Returns TRUE if the Visual used is the default for the default screen of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
.SH "bool QPaintDevice::x11AppDefaultVisual ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the Visual used is the default for screen \fIscreen\fR of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
.SH "int QPaintDevice::x11AppDepth ( int screen )\fC [static]\fR"
Returns the depth for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also QPixmap::defaultDepth().
.SH "int QPaintDevice::x11AppDepth ()\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the depth for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.PP
See also QPixmap::defaultDepth().
.SH "Display * QPaintDevice::x11AppDisplay ()\fC [static]\fR"
Returns a pointer to the X display global to the application (X11 only). Using this function is not portable.
.PP
See also handle().
.SH "int QPaintDevice::x11AppDpiX ( int screen )\fC [static]\fR"
Returns the horizontal DPI of the X display (X11 only) for screen \fIscreen\fR. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiY(), x11SetAppDpiX(), and QPaintDeviceMetrics::logicalDpiX().
.SH "int QPaintDevice::x11AppDpiX ()\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the horizontal DPI of the X display (X11 only) for the default screen. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.SH "int QPaintDevice::x11AppDpiY ( int screen )\fC [static]\fR"
Returns the vertical DPI of the X11 display (X11 only) for screen \fIscreen\fR. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
.SH "int QPaintDevice::x11AppDpiY ()\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the vertical DPI of the X11 display (X11 only) for the default screen. Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable.
.PP
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
.SH "Qt::HANDLE QPaintDevice::x11AppRootWindow ()\fC [static]\fR"
Returns the root window for the default screen of the X display global to the applicatoin (X11 only). Using this function is not portable.
.SH "Qt::HANDLE QPaintDevice::x11AppRootWindow ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the root window for screen \fIscreen\fR of the X display global to the applicatoin (X11 only). Using this function is not portable.
.SH "int QPaintDevice::x11AppScreen ()\fC [static]\fR"
Returns the screen number on the X display global to the application (X11 only). Using this function is not portable.
.SH "void * QPaintDevice::x11AppVisual ()\fC [static]\fR"
Returns the Visual for the default screen of the X display global to the application (X11 only). Using this function is not portable.
.SH "void * QPaintDevice::x11AppVisual ( int screen )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the Visual for screen \fIscreen\fR of the X display global to the application (X11 only). Using this function is not portable.
.SH "int QPaintDevice::x11Cells () const"
Returns the number of entries in the colormap of the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also x11Colormap().
.SH "Qt::HANDLE QPaintDevice::x11Colormap () const"
Returns the colormap of the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "bool QPaintDevice::x11DefaultColormap () const"
Returns the default colormap of the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also x11Cells().
.SH "bool QPaintDevice::x11DefaultVisual () const"
Returns the default Visual of the X display for the paint device (X11 only). Using this function is not portable.
.SH "int QPaintDevice::x11Depth () const"
Returns the depth of the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also QPixmap::defaultDepth().
.SH "Display * QPaintDevice::x11Display () const"
Returns a pointer to the X display for the paint device (X11 only). Using this function is not portable.
.PP
See also handle().
.SH "int QPaintDevice::x11Screen () const"
Returns the screen number on the X display for the paint device (X11 only). Using this function is not portable.
.SH "void QPaintDevice::x11SetAppDpiX ( int dpi, int screen )\fC [static]\fR"
Sets the value returned by x11AppDpiX() to \fIdpi\fR for screen \fIscreen\fR. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.PP
See also x11SetAppDpiY().
.SH "void QPaintDevice::x11SetAppDpiX ( int dpi )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the value returned by x11AppDpiX() to \fIdpi\fR for the default screen. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.SH "void QPaintDevice::x11SetAppDpiY ( int dpi, int screen )\fC [static]\fR"
Sets the value returned by x11AppDpiY() to \fIdpi\fR for screen \fIscreen\fR. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.PP
See also x11SetAppDpiX().
.SH "void QPaintDevice::x11SetAppDpiY ( int dpi )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the value returned by x11AppDpiY() to \fIdpi\fR for the default screen. The default is determined by the display configuration. Changing this value will alter the scaling of fonts and many other metrics and is not recommended. Using this function is not portable.
.SH "void * QPaintDevice::x11Visual () const"
Returns the Visual of the X display for the paint device (X11 only). Using this function is not portable.
.SH RELATED FUNCTION DOCUMENTATION
.SH "void bitBlt ( QPaintDevice * dst, int dx, int dy, const QPaintDevice * src, int sx, int sy, int sw, int sh, Qt::RasterOp rop, bool ignoreMask )"
Copies a block of pixels from \fIsrc\fR to \fIdst\fR, perhaps merging each pixel according to the raster operation \fIrop\fR. \fIsx\fR, \fIsy\fR is the top-left pixel in \fIsrc\fR (0, 0) by default, \fIdx\fR, \fIdy\fR is the top-left position in \fIdst\fR and \fIsw\fR, \fIsh\fR is the size of the copied block (all of \fIsrc\fR by default).
.PP
The most common values for \fIrop\fR are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values.
.PP
If \fIignoreMask\fR is FALSE (the default) and \fIsrc\fR is a masked QPixmap, the entire blit is masked by \fIsrc\fR->mask().
.PP
If \fIsrc\fR, \fIdst\fR, \fIsw\fR or \fIsh\fR is 0, bitBlt() does nothing. If \fIsw\fR or \fIsh\fR is negative bitBlt() copies starting at \fIsx\fR (and respectively, \fIsy\fR) and ending at the right end (respectively, bottom) of \fIsrc\fR.
.PP
\fIsrc\fR must be a TQWidget or QPixmap. You cannot blit from a QPrinter, for example. bitBlt() does nothing if you attempt to blit from an unsupported device.
.PP
bitBlt() does nothing if \fIsrc\fR has a greater depth than \fIdst\fR. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().
.SH "void bitBlt ( QPaintDevice * dst, const QPoint & dp, const QPaintDevice * src, const QRect & sr, RasterOp rop )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Overloaded bitBlt() with the destination point \fIdp\fR and source
rectangle \fIsr\fR.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqpaintdevice.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqpaintdevice.3qt) and the Qt
version (3.3.8).