⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qpaintdevice.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
字号:
'\" t.TH QPaintDevice 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPaintDevice \- The base class of objects that can be painted.PP\fC#include <qpaintdevice.h>\fR.PPInherited by QPixmap, QWidget, QPicture and QPrinter..PP.SS "Public Members".in +1c.ti -1c.BI "virtual \fB~QPaintDevice\fR ()".br.ti -1c.BI "int \fBdevType\fR () const".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 "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 \fBx11AppDepth\fR ()".br.ti -1c.BI "int \fBx11AppCells\fR ()".br.ti -1c.BI "int \fBx11AppDpiX\fR ()".br.ti -1c.BI "int \fBx11AppDpiY\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 "void \fBx11SetAppDpiX\fR ( int dpi )".br.ti -1c.BI "void \fBx11SetAppDpiY\fR ( int dpi )".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.ti -1c.BI "virtual int \fBmetric\fR ( int ) const".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 DESCRIPTIONThe QPaintDevice class is the base class of objects that can be painted..PPA 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..PPThe 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, by QPainter::setWorldMatrix()..PPExample (draw on a paint device):.PP.nf.brvoid 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 positin (10, 20).br    p.end();                          // painting done.br}.fi.PPThe 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()..PPExample (scroll widget contents 10 pixels to the right):.PP.nf.br    bitBlt( myWidget, 10, 0, myWidget );.br.fi.PP\fBWarning:\fR Qt requires that a QApplication object must exist 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..PPSee 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 subclasses of QPaintDevice..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..PPImplemented by subclasses that have no direct support for drawing graphics (external paint devices - for example, QPicture)..SH "int QPaintDevice::devType () const"Returns the device type identifier, which is \fCQInternal::Widget\fR if the device is a QWidget, \fCQInternal::Pixmap\fR if it's a QPixmap, \fCQInternal::Printer\fR if it's a QPrinter, \fCQInternal::Picture\fR if it's a QPicture or \fCQInternal::UndefinedDevice\fR in other cases (which should never happen)..SH "HDC 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..PPThe HANDLE type varies with platform; see qpaintdevice.h and qwindowdefs.h for details..PPSee also x11Display()..SH "bool QPaintDevice::isExtDev () const"Returns TRUE if the device is an external paint device; otherwise returns FALSE..PPExternal paint devices cannot be bitBlt()'ed from. QPicture and QPrinter are external paint devices..SH "int QPaintDevice::metric ( int ) const\fC [virtual protected]\fR"Internal virtual function that returns paint device metrics..PPPlease use the QPaintDeviceMetrics class instead..PPReimplemented in QPixmap, QWidget and QPicture..SH "bool QPaintDevice::paintingActive () const"Returns TRUE if the device is being painted, i.e. someone has called QPainter::begin() but not yet QPainter::end() for this device; otherwise returns FALSE..PPSee also QPainter::isActive()..SH "int QPaintDevice::x11AppCells ()\fC [static]\fR"Returns the number of entries in the colormap of the X display global to the application (X11 only). Using this function is not portable..PPSee also x11Colormap()..SH "Qt::HANDLE QPaintDevice::x11AppColormap ()\fC [static]\fR"Returns the colormap of the X display global to the application (X11 only). Using this function is not portable..PPSee also x11Cells()..SH "bool QPaintDevice::x11AppDefaultColormap ()\fC [static]\fR"Returns the default colormap of the X display global to the application (X11 only). Using this function is not portable..PPSee also x11Cells()..SH "bool QPaintDevice::x11AppDefaultVisual ()\fC [static]\fR"Returns the default Visual of the X display global to the application (X11 only). Using this function is not portable..SH "int QPaintDevice::x11AppDepth ()\fC [static]\fR"Returns the depth of the X display global to the application (X11 only). Using this function is not portable..PPSee 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..PPSee also handle()..SH "int QPaintDevice::x11AppDpiX ()\fC [static]\fR"Returns the horizontal DPI of the X display (X11 only). Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable..PPSee also x11AppDpiY(), x11SetAppDpiX() and QPaintDeviceMetrics::logicalDpiX()..SH "int QPaintDevice::x11AppDpiY ()\fC [static]\fR"Returns the vertical DPI of the X11 display (X11 only). Using this function is not portable. See QPaintDeviceMetrics for portable access to related information. Using this function is not portable..PPSee also x11AppDpiX(), x11SetAppDpiY() and QPaintDeviceMetrics::logicalDpiY()..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 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..PPSee 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..PPSee 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..PPSee 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..PPSee 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..PPSee 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 )\fC [static]\fR"Sets the value returned by x11AppDpiX() to \fIdpi\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..PPSee also x11SetAppDpiY()..SH "void QPaintDevice::x11SetAppDpiY ( int dpi )\fC [static]\fR"Sets the value returned by x11AppDpiY() to \fIdpi\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..PPSee also x11SetAppDpiX()..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)..PPThe most common values for \fIrop\fR are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values..PPIf \fIignoreMask\fR is TRUE (the default is FALSE) and \fIsrc\fR is a masked QPixmap, the entire blit is masked by \fIsrc\fR->mask()..PPIf \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 resp. \fIsy\fR) and ending at the right end (resp. bottom) of \fIsrc\fR..PP\fIsrc\fR 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..PPbitBlt() 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..PPOverloaded bitBlt() with the destination point \fIdp\fR and source rectangle \fIsr\fR..PP.SH "SEE ALSO".BR http://doc.trolltech.com/qpaintdevice.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf 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..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qpaintdevice.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -