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

📄 qcanvaspolygonalitem.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
字号:
'\" t.TH QCanvasPolygonalItem 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 NAMEQCanvasPolygonalItem \- Polygonal canvas item on a QCanvas.PP\fC#include <qcanvas.h>\fR.PPInherits QCanvasItem..PPInherited by QCanvasRectangle, QCanvasPolygon, QCanvasLine and QCanvasEllipse..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCanvasPolygonalItem\fR ( QCanvas * canvas )".br.ti -1c.BI "virtual \fB~QCanvasPolygonalItem\fR ()".br.ti -1c.BI "virtual void \fBsetPen\fR ( QPen p )".br.ti -1c.BI "virtual void \fBsetBrush\fR ( QBrush b )".br.ti -1c.BI "QPen \fBpen\fR () const".br.ti -1c.BI "QBrush \fBbrush\fR () const".br.ti -1c.BI "virtual QPointArray \fBareaPoints\fR () const".br.ti -1c.BI "virtual QPointArray \fBareaPointsAdvanced\fR () const".br.ti -1c.BI "virtual QRect \fBboundingRect\fR () const".br.ti -1c.BI "virtual int \fBrtti\fR () const".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBdraw\fR ( QPainter & p )".br.ti -1c.BI "virtual void \fBdrawShape\fR ( QPainter & p )".br.ti -1c.BI "bool \fBwinding\fR () const".br.ti -1c.BI "void \fBsetWinding\fR ( bool enable )".br.in -1c.SH DESCRIPTIONThe QCanvasPolygonalItem class provides a polygonal canvas item on a QCanvas..PPThe mostly rectangular classes, such as QCanvasSprite and QCanvasText, use the object's bounding rectangle for movement, repainting and collision calculation. However, for most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, but there are many other cases that are very bad. QCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., much speeding up such cases..PPDerived classes should try to define as small an area as possible to maximize efficiency, but the polygon must \fIdefinitely\fR be contained completely within the polygonal area. Calculating the exact requirements is usually difficult, but if you allow a small overestimate it can be easy and quick, while still getting almost all of QCanvasPolygonalItem's speed..PPNote that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints()..PPNormally, QCanvasPolygonalItem uses the odd-even algorithm for determining whether an object intersects this object. You can change this to the winding algorithm using setWinding()..PPThe bounding rectangle is available using boundingRect(). The points bounding the polygonal item are retrieved with areaPoints(). Use areaPointsAdvanced() to retrieve the bounding points the polygonal item \fIwill\fR have after QCanvasItem::advance(1) has been called..PPBy default, QCanvasPolygonalItem objects have a black pen and no brush (the default QPen and QBrush constructors). You can change this with setPen() and setBrush(), but note that some QCanvasPolygonalItem subclasses only use the brush, ignoring the pen setting..PPThe polygonal item can be drawn on a painter with draw(). Subclasses must reimplement drawShape() to draw themselves..PPLike any other canvas item polygonal items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ()..PPSee also Graphics Classes and Image Processing Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QCanvasPolygonalItem::QCanvasPolygonalItem ( QCanvas * canvas )"Constructs a QCanvasPolygonalItem on the canvas \fIcanvas\fR..SH "QCanvasPolygonalItem::~QCanvasPolygonalItem ()\fC [virtual]\fR"Note that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints()..SH "QPointArray QCanvasPolygonalItem::areaPoints () const\fC [virtual]\fR"Returns the points bounding the shape. Note that the returned points are \fIoutside\fR the object, not touching it..PPReimplemented in QCanvasPolygon..SH "QPointArray QCanvasPolygonalItem::areaPointsAdvanced () const\fC [virtual]\fR"Returns the points the polygonal item \fIwill\fR have after QCanvasItem::advance(1) is called, i.e. what the points are when advanced by the current xVelocity() and yVelocity()..SH "QRect QCanvasPolygonalItem::boundingRect () const\fC [virtual]\fR"Returns the bounding rectangle of the polygonal item, based on areaPoints()..PPReimplemented from QCanvasItem..SH "QBrush QCanvasPolygonalItem::brush () const"Returns the QBrush used to fill the item, if filled..PPSee also setBrush()..SH "void QCanvasPolygonalItem::draw ( QPainter & p )\fC [virtual protected]\fR"Reimplemented from QCanvasItem, this draws the polygonal item by setting the pen and brush for the item on the painter \fIp\fR and calling drawShape()..PPReimplemented from QCanvasItem..SH "void QCanvasPolygonalItem::drawShape ( QPainter & p )\fC [virtual protected]\fR"Subclasses must reimplement this function to draw their shape. The pen and brush of \fIp\fR are already set to pen() and brush() prior to calling this function..PPSee also draw()..PPReimplemented in QCanvasRectangle, QCanvasPolygon and QCanvasEllipse..SH "QPen QCanvasPolygonalItem::pen () const"Returns the QPen used to draw the outline of the item, if any..PPSee also setPen()..SH "int QCanvasPolygonalItem::rtti () const\fC [virtual]\fR"Returns 2 (QCanvasItem::Rtti_PolygonalItem)..PPSee also QCanvasItem::rtti()..PPReimplemented from QCanvasItem..PPReimplemented in QCanvasRectangle, QCanvasPolygon, QCanvasLine and QCanvasEllipse..SH "void QCanvasPolygonalItem::setBrush ( QBrush b )\fC [virtual]\fR"Sets the QBrush used when drawing the polygonal item to the brush \fIb\fR..PPSee also setPen(), brush() and drawShape()..SH "void QCanvasPolygonalItem::setPen ( QPen p )\fC [virtual]\fR"Sets the QPen used when drawing the item to the pen \fIp\fR. Note that many QCanvasPolygonalItems do not use the pen value..PPSee also setBrush(), pen() and drawShape()..SH "void QCanvasPolygonalItem::setWinding ( bool enable )\fC [protected]\fR"If \fIenable\fR is TRUE, the polygonal item will use the winding algorithm to determine the "inside" of the polygon; otherwise the odd-even algorithm will be used..PPThe default is to use the odd-even algorithm..PPSee also winding()..SH "bool QCanvasPolygonalItem::winding () const\fC [protected]\fR"Returns TRUE if the polygonal item uses the winding algorithm to determine the "inside" of the polygon. Returns FALSE if it uses the odd-even algorithm..PPThe default is to use the odd-even algorithm..PPSee also setWinding()..SH "SEE ALSO".BR http://doc.trolltech.com/qcanvaspolygonalitem.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 (qcanvaspolygonalitem.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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