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

📄 qcanvasitem.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QCanvasItem 3qt "9 December 2002" "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 NAMEQCanvasItem \- Abstract graphic object on a QCanvas.SH SYNOPSIS\fC#include <qcanvas.h>\fR.PPInherits Qt..PPInherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCanvasItem\fR ( QCanvas * canvas )".br.ti -1c.BI "virtual \fB~QCanvasItem\fR ()".br.ti -1c.BI "double \fBx\fR () const".br.ti -1c.BI "double \fBy\fR () const".br.ti -1c.BI "double \fBz\fR () const".br.ti -1c.BI "virtual void \fBmoveBy\fR ( double dx, double dy )".br.ti -1c.BI "void \fBmove\fR ( double x, double y )".br.ti -1c.BI "void \fBsetX\fR ( double x )".br.ti -1c.BI "void \fBsetY\fR ( double y )".br.ti -1c.BI "void \fBsetZ\fR ( double z )".br.ti -1c.BI "bool \fBanimated\fR () const".br.ti -1c.BI "virtual void \fBsetAnimated\fR ( bool y )".br.ti -1c.BI "virtual void \fBsetVelocity\fR ( double vx, double vy )".br.ti -1c.BI "void \fBsetXVelocity\fR ( double vx )".br.ti -1c.BI "void \fBsetYVelocity\fR ( double vy )".br.ti -1c.BI "double \fBxVelocity\fR () const".br.ti -1c.BI "double \fByVelocity\fR () const".br.ti -1c.BI "virtual void \fBadvance\fR ( int phase )".br.ti -1c.BI "virtual bool \fBcollidesWith\fR ( const QCanvasItem * other ) const = 0".br.ti -1c.BI "QCanvasItemList \fBcollisions\fR ( bool exact ) const".br.ti -1c.BI "virtual void \fBsetCanvas\fR ( QCanvas * c )".br.ti -1c.BI "virtual void \fBdraw\fR ( QPainter & painter ) = 0".br.ti -1c.BI "void \fBshow\fR ()".br.ti -1c.BI "void \fBhide\fR ()".br.ti -1c.BI "virtual void \fBsetVisible\fR ( bool yes )".br.ti -1c.BI "bool \fBisVisible\fR () const".br.ti -1c.BI "virtual void \fBsetSelected\fR ( bool yes )".br.ti -1c.BI "bool \fBisSelected\fR () const".br.ti -1c.BI "virtual void \fBsetEnabled\fR ( bool yes )".br.ti -1c.BI "bool \fBisEnabled\fR () const".br.ti -1c.BI "virtual void \fBsetActive\fR ( bool yes )".br.ti -1c.BI "bool \fBisActive\fR () const".br.ti -1c.BI "bool visible () const  \fI(obsolete)\fR".br.ti -1c.BI "bool selected () const  \fI(obsolete)\fR".br.ti -1c.BI "bool enabled () const  \fI(obsolete)\fR".br.ti -1c.BI "bool active () const  \fI(obsolete)\fR".br.ti -1c.BI "enum \fBRttiValues\fR { Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2, Rtti_Text = 3, Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6, Rtti_Line = 7, Rtti_Spline = 8 }".br.ti -1c.BI "virtual int \fBrtti\fR () const".br.ti -1c.BI "virtual QRect \fBboundingRect\fR () const = 0".br.ti -1c.BI "virtual QRect \fBboundingRectAdvanced\fR () const".br.ti -1c.BI "QCanvas * \fBcanvas\fR () const".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "void \fBupdate\fR ()".br.in -1c.SH DESCRIPTIONThe QCanvasItem class provides an abstract graphic object on a QCanvas..PPA variety of QCanvasItem subclasses provide immediately usable behaviour. This class is a pure abstract superclass providing the behaviour that is shared among all the concrete canvas item classes. QCanvasItem is not intended for direct subclassing. It is much easier to subclass one of its subclasses, e.g. QCanvasPolygonalItem (the commonest base class), QCanvasRectangle, QCanvasSprite, QCanvasEllipse or QCanvasText..PPCanvas items are added to a canvas by constructing them and passing the canvas to the canvas item's constructor. An item can be moved to a different canvas using setCanvas()..PPItems appear on the canvas after their show() function has been called (or setVisible(TRUE)), and \fIafter\fR update() has been called. The canvas only shows items that are visible, and then only if update() is called. If you created the canvas without passing a width and height to the constructor you'll also need to call resize()..PPA QCanvasItem object can be moved in the x(), y() and z() dimensions using functions such as move(), moveBy(), setX(), setY() and setZ(). A canvas item can be set in motion, `animated', using setAnimated() and given a velocity in the x and y directions with setXVelocity() and setYVelocity() -- the same effect can be achieved by calling setVelocity(). Use the collidesWith() function to see if the canvas item will collide on the \fInext\fR advance(1) and use collisions() to see what collisions have occurred..PPUse QCanvasSprite or your own subclass of QCanvasSprite to create canvas items which are animated, i.e. which change over time..PPThe size of a canvas item is given by boundingRect(). Use boundingRectAdvanced() to see what the size of the canvas item will be \fIafter\fR the next advance(1) call..PPThe rtti() function is used for identifying subclasses of QCanvasItem. The canvas() function returns a pointer to the canvas which contains the canvas item..PPQCanvasItem provides the show() and isVisible() functions like those in QWidget..PPQCanvasItem also provides the setEnabled(), setActive() and setSelected() functions; these functions set the relevant boolean and cause a repaint but the boolean values they set are not used in QCanvasItem itself. You can make use of these booleans in your subclasses..PPBy default, canvas items have no velocity, no size, and are not in motion. The subclasses provided in Qt do not change these defaults except where noted..PPSee also Graphics Classes and Image Processing Classes..SS "Member Type Documentation".SH "QCanvasItem::RttiValues"This enum is used to name the different types of canvas item..TP\fCQCanvasItem::Rtti_Item\fR - Canvas item abstract base class.TP\fCQCanvasItem::Rtti_Ellipse\fR.TP\fCQCanvasItem::Rtti_Line\fR.TP\fCQCanvasItem::Rtti_Polygon\fR.TP\fCQCanvasItem::Rtti_PolygonalItem\fR.TP\fCQCanvasItem::Rtti_Rectangle\fR.TP\fCQCanvasItem::Rtti_Spline\fR.TP\fCQCanvasItem::Rtti_Sprite\fR.TP\fCQCanvasItem::Rtti_Text\fR.PP.SH MEMBER FUNCTION DOCUMENTATION.SH "QCanvasItem::QCanvasItem ( QCanvas * canvas )"Constructs a QCanvasItem on canvas \fIcanvas\fR..PPSee also setCanvas()..SH "QCanvasItem::~QCanvasItem ()\fC [virtual]\fR"Destroys the QCanvasItem and removes it from its canvas..SH "bool QCanvasItem::active () const"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPUse isActive() instead..SH "void QCanvasItem::advance ( int phase )\fC [virtual]\fR"The default implementation moves the canvas item, if it is animated(), by the preset velocity if \fIphase\fR is 1, and does nothing if \fIphase\fR is 0..PPNote that if you reimplement this function, the reimplementation must not change the canvas in any way, for example it must not add or remove items.

⌨️ 快捷键说明

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