Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QPaintDevice class is the base class of objects that can be painted. More...
#include <qpaintdevice.h>
Inherited by QPixmap, QWidget, QPicture, and QPrinter.
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 QWidget, QPixmap, QPicture and QPrinter.
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().
Example (draw on a paint device):
void MyWidget::paintEvent( QPaintEvent * ) { QPainter p; // our painter p.begin( this ); // start painting the widget p.setPen( red ); // red outline p.setBrush( yellow ); // yellow fill p.drawEllipse( 10, 20, 100,100 ); // 100x100 ellipse at position (10, 20) p.end(); // painting done }
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().
Example (scroll widget contents 10 pixels to the right):
bitBlt( myWidget, 10, 0, myWidget );
Warning: Qt 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.
See also Graphics Classes and Image Processing Classes.
Implemented by subclasses that have no direct support for drawing graphics (external paint devices, for example, QPicture).
The HANDLE type varies with platform; see qpaintdevice.h and qwindowdefs.h for details.
See also x11Display().
Returns TRUE if the device is an external paint device; otherwise returns FALSE.
External paint devices cannot be bitBlt()'ed from. QPicture and QPrinter are external paint devices.
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.
See also QPainter::isActive().
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.
See also x11Colormap().
Returns the number of entries in the colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Colormap().
Returns the colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also x11Cells().
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.
Returns TRUE if the Visual used is the default for screen screen of the X display global to the application (X11 only); otherwise returns FALSE. Using this function is not portable.
Returns the depth for screen screen of the X display global to the application (X11 only). Using this function is not portable.
See also QPixmap::defaultDepth().
Returns the depth for the default screen of the X display global to the application (X11 only). Using this function is not portable.
See also QPixmap::defaultDepth().
Returns a pointer to the X display global to the application (X11 only). Using this function is not portable.
See also handle().
See also x11AppDpiY(), x11SetAppDpiX(), and QPaintDeviceMetrics::logicalDpiX().
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.
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
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.
See also x11AppDpiX(), x11SetAppDpiY(), and QPaintDeviceMetrics::logicalDpiY().
Returns the root window for the default screen of the X display global to the applicatoin (X11 only). Using this function is not portable.
Returns the root window for screen screen of the X display global to the applicatoin (X11 only). Using this function is not portable.
Returns the screen number on the X display global to the application (X11 only). Using this function is not portable.
Returns the Visual for the default screen of the X display global to the application (X11 only). Using this function is not portable.
Returns the Visual for screen screen of the X display global to the application (X11 only). Using this function is not portable.
Returns the number of entries in the colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Colormap().
Returns the colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default colormap of the X display for the paint device (X11 only). Using this function is not portable.
See also x11Cells().
Returns the default Visual of the X display for the paint device (X11 only). Using this function is not portable.
Returns the depth of the X display for the paint device (X11 only). Using this function is not portable.
See also QPixmap::defaultDepth().
Returns a pointer to the X display for the paint device (X11 only). Using this function is not portable.
See also handle().
Returns the screen number on the X display for the paint device (X11 only). Using this function is not portable.
See also x11SetAppDpiY().
Sets the value returned by x11AppDpiX() to dpi 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.
See also x11SetAppDpiX().
Sets the value returned by x11AppDpiY() to dpi 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.
Returns the Visual of the X display for the paint device (X11 only). Using this function is not portable.
Copies a block of pixels from src to dst, perhaps merging each pixel according to the raster operation rop. sx, sy is the top-left pixel in src (0, 0) by default, dx, dy is the top-left position in dst and sw, sh is the size of the copied block (all of src by default).
The most common values for rop are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values.
If ignoreMask is TRUE (the default is FALSE) and src is a masked QPixmap, the entire blit is masked by src->mask().
If src, dst, sw or sh is 0, bitBlt() does nothing. If sw or sh is negative bitBlt() copies starting at sx (and respectively, sy) and ending at the right end (respectively, bottom) of src.
src must be a QWidget or QPixmap. You cannot blit from a QPrinter, for example. bitBlt() does nothing if you attempt to blit from an unsupported device.
bitBlt() does nothing if src has a greater depth than dst. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Overloaded bitBlt() with the destination point dp and source rectangle sr.
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Copyright © 2003 Trolltech | Trademarks | Qt version 3.1.2
|