<trbgcolor=#f0f0f0><td><b><ahref="ntqbutton.html">TQButton</a></b><td>The abstract base class of button widgets, providing functionality common to buttons
<trbgcolor=#f0f0f0><td><b><ahref="ntqcanvas.html">TQCanvas</a></b><td>2D area that can contain TQCanvasItem objects
<trbgcolor=#f0f0f0><td><b><ahref="tqcanvas.html">TQCanvas</a></b><td>2D area that can contain TQCanvasItem objects
<trbgcolor=#f0f0f0><td><b><ahref="ntqdialog.html">TQDialog</a></b><td>The base class of dialog windows
<trbgcolor=#f0f0f0><td><b><ahref="ntqframe.html">TQFrame</a></b><td>The base class of widgets that can have a frame
<trbgcolor=#f0f0f0><td><b><ahref="ntqgridview.html">TQGridView</a></b><td>Abstract base for fixed-size grids
<p> The canvas module provides a highly optimized 2D graphic area called
<ahref="ntqcanvas.html">TQCanvas</a>. The canvas can contain an arbitrary number of <ahref="qcanvasitem.html">TQCanvasItems</a>. Canvas items can have an arbitrary
<ahref="tqcanvas.html">TQCanvas</a>. The canvas can contain an arbitrary number of <ahref="tqcanvasitem.html">TQCanvasItems</a>. Canvas items can have an arbitrary
shape, size and content, can be freely moved around in the canvas,
and can be checked for collisions. Canvas items can be set to move
across the canvas automatically and animated canvas items are
supported with <ahref="qcanvassprite.html">TQCanvasSprite</a>. (If you require 3D graphics see TQt's
supported with <ahref="tqcanvassprite.html">TQCanvasSprite</a>. (If you require 3D graphics see TQt's
<ahref="opengl.html">OpenGL module</a>.)
<p> The canvas module uses a document/view model. The <ahref="qcanvasview.html">TQCanvasView</a> class
<p> The canvas module uses a document/view model. The <ahref="tqcanvasview.html">TQCanvasView</a> class
is used to show a particular view of a canvas. Multiple views can operate
on the same canvas at the same time. Every view can use an arbitrary
<ahref="ntqwmatrix.html#TransformationMode">transformation matrix</a> on the canvas which makes it easy to implement
features such as zooming.
<p><center><ahref="ntqcanvas.html">
<imgsrc="qcanvas.png" alt="Screenshot of a canvas"></a></center>
<p> TQt provides a number of predefined <ahref="ntqcanvas.html">TQCanvas</a> items as listed below.
<p><center><ahref="tqcanvas.html">
<imgsrc="tqcanvas.png" alt="Screenshot of a canvas"></a></center>
<p> TQt provides a number of predefined <ahref="tqcanvas.html">TQCanvas</a> items as listed below.
<p><ul>
<li><ahref="qcanvasitem.html">TQCanvasItem</a> -- An abstract base class for all canvas items.
<li><ahref="qcanvasellipse.html">TQCanvasEllipse</a> -- An ellipse or "pie segment".
<li><ahref="qcanvasline.html">TQCanvasLine</a> -- A line segment.
<li><ahref="qcanvaspolygon.html">TQCanvasPolygon</a> -- A polygon.
<li><ahref="qcanvaspolygonalitem.html">TQCanvasPolygonalItem</a> -- A base class for items that have a
<li><ahref="tqcanvasitem.html">TQCanvasItem</a> -- An abstract base class for all canvas items.
<li><ahref="tqcanvasellipse.html">TQCanvasEllipse</a> -- An ellipse or "pie segment".
<li><ahref="tqcanvasline.html">TQCanvasLine</a> -- A line segment.
<li><ahref="tqcanvaspolygon.html">TQCanvasPolygon</a> -- A polygon.
<li><ahref="tqcanvaspolygonalitem.html">TQCanvasPolygonalItem</a> -- A base class for items that have a
non-rectangular shape. Most canvas items derive from this class.
<li><ahref="qcanvasrectangle.html">TQCanvasRectangle</a> -- A rectangle. The rectangle cannot be tilted or
<li><ahref="tqcanvasrectangle.html">TQCanvasRectangle</a> -- A rectangle. The rectangle cannot be tilted or
rotated. Rotated rectangles can be drawn using TQCanvasPolygon.
<li><ahref="qcanvasspline.html">TQCanvasSpline</a> -- A multi-bezier spline.
<li><ahref="qcanvassprite.html">TQCanvasSprite</a> -- An animated pixmap.
<li><ahref="qcanvastext.html">TQCanvasText</a> -- A text string.
<li><ahref="tqcanvasspline.html">TQCanvasSpline</a> -- A multi-bezier spline.
<li><ahref="tqcanvassprite.html">TQCanvasSprite</a> -- An animated pixmap.
<li><ahref="tqcanvastext.html">TQCanvasText</a> -- A text string.
</ul>
<p> The two classes <ahref="qcanvaspixmap.html">TQCanvasPixmap</a> and <ahref="qcanvaspixmaparray.html">TQCanvasPixmapArray</a> are used
by <ahref="qcanvassprite.html">TQCanvasSprite</a> to show animated and moving pixmaps on the
<p> The two classes <ahref="tqcanvaspixmap.html">TQCanvasPixmap</a> and <ahref="tqcanvaspixmaparray.html">TQCanvasPixmapArray</a> are used
by <ahref="tqcanvassprite.html">TQCanvasSprite</a> to show animated and moving pixmaps on the
canvas.
<p> More specialized items can be created by inheriting from one of the
canvas item classes. It is easiest to inherit from one of
<ahref="qcanvasitem.html">TQCanvasItem</a>'s derived classes (usually <ahref="qcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>) rather
<ahref="tqcanvasitem.html">TQCanvasItem</a>'s derived classes (usually <ahref="tqcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>) rather
than inherit TQCanvasItem directly.
<p> See <tt>examples/canvas</tt> for an example that shows off some of <ahref="ntqcanvas.html">TQCanvas</a>'s
<p> See <tt>examples/canvas</tt> for an example that shows off some of <ahref="tqcanvas.html">TQCanvas</a>'s
<p>Inherited by <ahref="qcanvasview.html">TQCanvasView</a>, <ahref="ntqtable.html">TQTable</a>, <ahref="ntqgridview.html">TQGridView</a>, <ahref="ntqiconview.html">TQIconView</a>, <ahref="ntqlistbox.html">TQListBox</a>, <ahref="ntqlistview.html">TQListView</a>, and <ahref="ntqtextedit.html">TQTextEdit</a>.
<p>Inherited by <ahref="tqcanvasview.html">TQCanvasView</a>, <ahref="ntqtable.html">TQTable</a>, <ahref="ntqgridview.html">TQGridView</a>, <ahref="ntqiconview.html">TQIconView</a>, <ahref="ntqlistbox.html">TQListBox</a>, <ahref="ntqlistview.html">TQListView</a>, and <ahref="ntqtextedit.html">TQTextEdit</a>.
<p><ahref="qscrollview-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
@ -558,7 +558,7 @@ rectangle is in the scrollview's coordinates.
<p>Inherited by <ahref="qcanvasitemlist.html">TQCanvasItemList</a>, <ahref="ntqstringlist.html">TQStringList</a>, and <ahref="ntqvaluestack.html">TQValueStack</a>.
<p>Inherited by <ahref="tqcanvasitemlist.html">TQCanvasItemList</a>, <ahref="ntqstringlist.html">TQStringList</a>, and <ahref="ntqvaluestack.html">TQValueStack</a>.
<p><ahref="qvaluelist-members.html">List of all member functions.</a>
<li><ahref="qcolorgroup.html#TQColorGroup">TQColorGroup::TQColorGroup</a>( const <ahref="ntqcolor.html">TQColor</a>& foreground, const TQColor & background, const TQColor & light, const TQColor & dark, const TQColor & mid, const TQColor & text, const TQColor & base )
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasEllipse</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasellipse.html">TQCanvasEllipse</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasItem</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasitem.html">TQCanvasItem</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasLine</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasline.html">TQCanvasLine</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPolygon</h1>
<p>This is the complete list of member functions for
<ahref="qcanvaspolygon.html">TQCanvasPolygon</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPolygonalItem</h1>
<p>This is the complete list of member functions for
<ahref="qcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasRectangle</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasrectangle.html">TQCanvasRectangle</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasSpline</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasspline.html">TQCanvasSpline</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasSprite</h1>
<p>This is the complete list of member functions for
<ahref="qcanvassprite.html">TQCanvasSprite</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasText</h1>
<p>This is the complete list of member functions for
<ahref="qcanvastext.html">TQCanvasText</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvas</h1>
<p>This is the complete list of member functions for
<ahref="ntqcanvas.html">TQCanvas</a>, including inherited members.
<ahref="tqcanvas.html">TQCanvas</a>, including inherited members.
<ahref="tqcanvassprite.html">TQCanvasSprite</a> and <ahref="tqcanvastext.html">TQCanvasText</a>. You can subclass to create your own
canvas items; TQCanvasPolygonalItem is the most common base class used
for this purpose.
<p> Items appear on the canvas after their <ahref="qcanvasitem.html#show">show()</a> function has been called (or <ahref="qcanvasitem.html#setVisible">setVisible(TRUE)</a>), and <em>after</em>
<p> Items appear on the canvas after their <ahref="tqcanvasitem.html#show">show()</a> function has been called (or <ahref="tqcanvasitem.html#setVisible">setVisible(TRUE)</a>), and <em>after</em>
<ahref="#update">update</a>() has been called. The canvas only shows items that are
<ahref="qcanvasitem.html#setVisible">visible</a>, and then only if
<ahref="tqcanvasitem.html#setVisible">visible</a>, and then only if
<ahref="#update">update</a>() is called. (By default the canvas is white and so are
canvas items, so if nothing appears try changing colors.)
<p> If you created the canvas without passing a width and height to
@ -138,7 +138,7 @@ whereas TQCanvas scales well. Even with a billion pixels and a million
items, finding a particular canvas item, detecting collisions, etc.,
is still fast (though the memory consumption may be prohibitive
at such extremes).
<p><li> Two or more <ahref="qcanvasview.html">TQCanvasView</a> objects can view the same canvas.
<p><li> Two or more <ahref="tqcanvasview.html">TQCanvasView</a> objects can view the same canvas.
<p><li> An arbitrary <ahref="ntqwmatrix.html#TransformationMode">transformation matrix</a> can be set on each TQCanvasView
which makes it easy to zoom, rotate or shear the viewed canvas.
<p><li> Widgets provide a lot more functionality, such as input (<ahref="qkeyevent.html">TQKeyEvent</a>,
@ -157,29 +157,29 @@ are corresponding get functions, e.g. <a href="#backgroundColor">backgroundColor
<p> Note that TQCanvas does not inherit from <ahref="ntqwidget.html">TQWidget</a>, even though it has some
functions which provide the same functionality as those in TQWidget. One
of these is setBackgroundPixmap(); some others are <ahref="#resize">resize</a>(), <ahref="#size">size</a>(),
<ahref="#width">width</a>() and <ahref="#height">height</a>(). <ahref="qcanvasview.html">TQCanvasView</a> is the widget used to display a
<ahref="#width">width</a>() and <ahref="#height">height</a>(). <ahref="tqcanvasview.html">TQCanvasView</a> is the widget used to display a
canvas on the screen.
<p> Canvas 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 <ahref="qcanvasitem.html#setCanvas">TQCanvasItem::setCanvas</a>().
different canvas using <ahref="tqcanvasitem.html#setCanvas">TQCanvasItem::setCanvas</a>().
<p> Canvas items are movable (and in the case of TQCanvasSprites, animated)
objects that inherit <ahref="qcanvasitem.html">TQCanvasItem</a>. Each canvas item has a position on the
objects that inherit <ahref="tqcanvasitem.html">TQCanvasItem</a>. Each canvas item has a position on the
canvas (x, y coordinates) and a height (z coordinate), all of which are
held as floating-point numbers. Moving canvas items also have x and y
velocities. It's possible for a canvas item to be outside the canvas
(for example <ahref="qcanvasitem.html#x">TQCanvasItem::x</a>() is greater than width()). When a canvas
(for example <ahref="tqcanvasitem.html#x">TQCanvasItem::x</a>() is greater than width()). When a canvas
item is off the canvas, <ahref="#onCanvas">onCanvas</a>() returns FALSE and the canvas
disregards the item. (Canvas items off the canvas do not slow down any
of the common operations on the canvas.)
<p> Canvas items can be moved with <ahref="qcanvasitem.html#move">TQCanvasItem::move</a>(). The <ahref="#advance">advance</a>()
function moves all <ahref="qcanvasitem.html#animated">TQCanvasItem::animated</a>() canvas items and
<p> Canvas items can be moved with <ahref="tqcanvasitem.html#move">TQCanvasItem::move</a>(). The <ahref="#advance">advance</a>()
function moves all <ahref="tqcanvasitem.html#animated">TQCanvasItem::animated</a>() canvas items and
<ahref="#setAdvancePeriod">setAdvancePeriod</a>() makes TQCanvas move them automatically on a periodic
basis. In the context of the TQCanvas classes, to `animate' a canvas item
is to set it in motion, i.e. using <ahref="qcanvasitem.html#setVelocity">TQCanvasItem::setVelocity</a>(). Animation
is to set it in motion, i.e. using <ahref="tqcanvasitem.html#setVelocity">TQCanvasItem::setVelocity</a>(). Animation
of a canvas item itself, i.e. items which change over time, is enabled
by calling <ahref="qcanvassprite.html#setFrameAnimation">TQCanvasSprite::setFrameAnimation</a>(), or more generally by
subclassing and reimplementing <ahref="qcanvasitem.html#advance">TQCanvasItem::advance</a>(). To detect collisions
use one of the <ahref="qcanvasitem.html#collisions">TQCanvasItem::collisions</a>() functions.
by calling <ahref="tqcanvassprite.html#setFrameAnimation">TQCanvasSprite::setFrameAnimation</a>(), or more generally by
subclassing and reimplementing <ahref="tqcanvasitem.html#advance">TQCanvasItem::advance</a>(). To detect collisions
use one of the <ahref="tqcanvasitem.html#collisions">TQCanvasItem::collisions</a>() functions.
<p> The changed parts of the canvas are redrawn (if they are visible in a
canvas view) whenever <ahref="#update">update</a>() is called. You can either call update()
manually after having changed the contents of the canvas, or force
@ -187,7 +187,7 @@ periodic updates using <a href="#setUpdatePeriod">setUpdatePeriod</a>(). If you
the canvas, you must call <ahref="#advance">advance</a>() every time the objects should
move one step further. Periodic calls to advance() can be forced using
<ahref="#setAdvancePeriod">setAdvancePeriod</a>(). The advance() function will call
TQCanvasItem::advance() on every item that is <ahref="qcanvasitem.html#animated">animated</a> and trigger an update of the
TQCanvasItem::advance() on every item that is <ahref="tqcanvasitem.html#animated">animated</a> and trigger an update of the
affected areas afterwards. (A canvas item that is `animated' is simply
a canvas item that is in motion.)
<p> TQCanvas organizes its canvas items into <em>chunks</em>; these are areas on
@ -218,7 +218,7 @@ items.
<p> If the canvas is resized it emits the <ahref="#resized">resized</a>() signal.
<p> The examples/canvas application and the 2D graphics page of the
examples/demo application demonstrate many of TQCanvas's facilities.
<p><p>See also <ahref="qcanvasview.html">TQCanvasView</a>, <ahref="qcanvasitem.html">TQCanvasItem</a>, <ahref="abstractwidgets.html">Abstract Widget Classes</a>, <ahref="graphics.html">Graphics Classes</a>, and <ahref="images.html">Image Processing Classes</a>.
<p><p>See also <ahref="tqcanvasview.html">TQCanvasView</a>, <ahref="tqcanvasitem.html">TQCanvasItem</a>, <ahref="abstractwidgets.html">Abstract Widget Classes</a>, <ahref="graphics.html">Graphics Classes</a>, and <ahref="images.html">Image Processing Classes</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasEllipse</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvasellipse.html">TQCanvasEllipse</a>, including inherited members.
<p> If a start angle and length angle are set then an ellipse segment
will be drawn. The start angle is the angle that goes from zero in a
counter-clockwise direction (shown in green in the diagram). The
@ -79,22 +79,22 @@ segment is the segment of the ellipse that would be drawn. If no
start angle and length angle are specified the entire ellipse is
drawn.
<p> The ellipse can be drawn on a painter with <ahref="#drawShape">drawShape</a>().
<p> Like any other canvas item ellipses can be moved with <ahref="qcanvasitem.html#move">move</a>() and
<ahref="qcanvasitem.html#moveBy">moveBy</a>(), or by setting coordinates with <ahref="qcanvasitem.html#setX">setX</a>(), <ahref="qcanvasitem.html#setY">setY</a>() and <ahref="qcanvasitem.html#setZ">setZ</a>().
<p> Like any other canvas item ellipses can be moved with <ahref="tqcanvasitem.html#move">move</a>() and
<ahref="tqcanvasitem.html#moveBy">moveBy</a>(), or by setting coordinates with <ahref="tqcanvasitem.html#setX">setX</a>(), <ahref="tqcanvasitem.html#setY">setY</a>() and <ahref="tqcanvasitem.html#setZ">setZ</a>().
<p> Note: TQCanvasEllipse does not use the pen.
<p>See also <ahref="graphics.html">Graphics Classes</a> and <ahref="images.html">Image Processing Classes</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasItem</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvasitem.html">TQCanvasItem</a>, including inherited members.
<p>Inherited by <ahref="qcanvassprite.html">TQCanvasSprite</a>, <ahref="qcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>, and <ahref="qcanvastext.html">TQCanvasText</a>.
<p><ahref="qcanvasitem-members.html">List of all member functions.</a>
<p>Inherited by <ahref="tqcanvassprite.html">TQCanvasSprite</a>, <ahref="tqcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>, and <ahref="tqcanvastext.html">TQCanvasText</a>.
<p><ahref="tqcanvasitem-members.html">List of all member functions.</a>
Returns TRUE if the canvas item is in motion; otherwise returns
@ -193,18 +193,18 @@ FALSE.
<p> Returns the bounding rectangle in pixels that the canvas item covers.
<p><p>See also <ahref="#boundingRectAdvanced">boundingRectAdvanced</a>().
<p>Reimplemented in <ahref="qcanvassprite.html#boundingRect">TQCanvasSprite</a>, <ahref="qcanvaspolygonalitem.html#boundingRect">TQCanvasPolygonalItem</a>, and <ahref="qcanvastext.html#boundingRect">TQCanvasText</a>.
<p>Reimplemented in <ahref="tqcanvassprite.html#boundingRect">TQCanvasSprite</a>, <ahref="tqcanvaspolygonalitem.html#boundingRect">TQCanvasPolygonalItem</a>, and <ahref="tqcanvastext.html#boundingRect">TQCanvasText</a>.
Returns the list of canvas items that this canvas item has
collided with.
@ -257,7 +257,7 @@ code by calling TQPainter::translate(-50, -50). Be also aware that
the painter might already have some transformations set (i.e.,
don't call <ahref="ntqpainter.html#resetXForm">TQPainter::resetXForm</a>() when you're done).
<p>Reimplemented in <ahref="qcanvassprite.html#draw">TQCanvasSprite</a>, <ahref="qcanvaspolygonalitem.html#draw">TQCanvasPolygonalItem</a>, and <ahref="qcanvastext.html#draw">TQCanvasText</a>.
<p>Reimplemented in <ahref="tqcanvassprite.html#draw">TQCanvasSprite</a>, <ahref="tqcanvaspolygonalitem.html#draw">TQCanvasPolygonalItem</a>, and <ahref="tqcanvastext.html#draw">TQCanvasText</a>.
<p>Reimplemented in <ahref="qcanvassprite.html#rtti">TQCanvasSprite</a>, <ahref="qcanvaspolygonalitem.html#rtti">TQCanvasPolygonalItem</a>, and <ahref="qcanvastext.html#rtti">TQCanvasText</a>.
<p>Reimplemented in <ahref="tqcanvassprite.html#rtti">TQCanvasSprite</a>, <ahref="tqcanvaspolygonalitem.html#rtti">TQCanvasPolygonalItem</a>, and <ahref="tqcanvastext.html#rtti">TQCanvasText</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasItemList</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasitemlist.html">TQCanvasItemList</a>, including inherited members.
<ahref="tqcanvasitemlist.html">TQCanvasItemList</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasLine</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvasline.html">TQCanvasLine</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPixmap</h1>
<p>This is the complete list of member functions for
<ahref="qcanvaspixmap.html">TQCanvasPixmap</a>, including inherited members.
<ahref="tqcanvaspixmap.html">TQCanvasPixmap</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPixmapArray</h1>
<p>This is the complete list of member functions for
<ahref="qcanvaspixmaparray.html">TQCanvasPixmapArray</a>, including inherited members.
<ahref="tqcanvaspixmaparray.html">TQCanvasPixmapArray</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPolygon</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvaspolygon.html">TQCanvasPolygon</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasPolygonalItem</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvaspolygonalitem.html">TQCanvasPolygonalItem</a>, including inherited members.
<p>Inherited by <ahref="qcanvasrectangle.html">TQCanvasRectangle</a>, <ahref="qcanvaspolygon.html">TQCanvasPolygon</a>, <ahref="qcanvasline.html">TQCanvasLine</a>, and <ahref="qcanvasellipse.html">TQCanvasEllipse</a>.
<p><ahref="qcanvaspolygonalitem-members.html">List of all member functions.</a>
<p>Inherited by <ahref="tqcanvasrectangle.html">TQCanvasRectangle</a>, <ahref="tqcanvaspolygon.html">TQCanvasPolygon</a>, <ahref="tqcanvasline.html">TQCanvasLine</a>, and <ahref="tqcanvasellipse.html">TQCanvasEllipse</a>.
<p><ahref="tqcanvaspolygonalitem-members.html">List of all member functions.</a>
The TQCanvasPolygonalItem class provides a polygonal canvas item
on a <ahref="ntqcanvas.html">TQCanvas</a>.
on a <ahref="tqcanvas.html">TQCanvas</a>.
<p>
<p> The mostly rectangular classes, such as <ahref="qcanvassprite.html">TQCanvasSprite</a> and
<ahref="qcanvastext.html">TQCanvasText</a>, use the object's bounding rectangle for movement,
<p> The mostly rectangular classes, such as <ahref="tqcanvassprite.html">TQCanvasSprite</a> and
<ahref="tqcanvastext.html">TQCanvasText</a>, use the object's bounding rectangle for movement,
repainting and collision calculations. For most other items, the
bounding rectangle can be far too large -- a diagonal line being
the worst case, and there are many other cases which are also bad.
@ -82,7 +82,7 @@ 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 TQCanvasPolygonalItem's speed.
<p> Note that all subclasses <em>must</em> call <ahref="qcanvasitem.html#hide">hide</a>() in their destructor
<p> Note that all subclasses <em>must</em> call <ahref="tqcanvasitem.html#hide">hide</a>() in their destructor
since hide() needs to be able to access <ahref="#areaPoints">areaPoints</a>().
<p> Normally, TQCanvasPolygonalItem uses the odd-even algorithm for
determining whether an object intersects this object. You can
@ -91,7 +91,7 @@ change this to the winding algorithm using <a href="#setWinding">setWinding</a>(
points bounding the polygonal item are retrieved with
areaPoints(). Use <ahref="#areaPointsAdvanced">areaPointsAdvanced</a>() to retrieve the bounding
points the polygonal item <em>will</em> have after
<ahref="qcanvasitem.html#advance">TQCanvasItem::advance</a>(1) has been called.
<ahref="tqcanvasitem.html#advance">TQCanvasItem::advance</a>(1) has been called.
<p> If the shape of the polygonal item is about to change while the
item is visible, call <ahref="#invalidate">invalidate</a>() before updating with a
different result from <ahref="#areaPoints">areaPoints</a>().
@ -103,18 +103,18 @@ pen setting.
<p> The polygonal item can be drawn on a painter with <ahref="#draw">draw</a>().
Subclasses must reimplement <ahref="#drawShape">drawShape</a>() to draw themselves.
<p> Like any other canvas item polygonal items can be moved with
<ahref="qcanvasitem.html#move">TQCanvasItem::move</a>() and <ahref="qcanvasitem.html#moveBy">TQCanvasItem::moveBy</a>(), or by setting coordinates
with <ahref="qcanvasitem.html#setX">TQCanvasItem::setX</a>(), <ahref="qcanvasitem.html#setY">TQCanvasItem::setY</a>() and <ahref="qcanvasitem.html#setZ">TQCanvasItem::setZ</a>().
<ahref="tqcanvasitem.html#move">TQCanvasItem::move</a>() and <ahref="tqcanvasitem.html#moveBy">TQCanvasItem::moveBy</a>(), or by setting coordinates
with <ahref="tqcanvasitem.html#setX">TQCanvasItem::setX</a>(), <ahref="tqcanvasitem.html#setY">TQCanvasItem::setY</a>() and <ahref="tqcanvasitem.html#setZ">TQCanvasItem::setZ</a>().
<p><p>See also <ahref="graphics.html">Graphics Classes</a> and <ahref="images.html">Image Processing Classes</a>.
@ -164,12 +164,12 @@ the painter might already have some transformations set (i.e.,
don't call <ahref="ntqpainter.html#resetXForm">TQPainter::resetXForm</a>() when you're done).
<p><p>See also <ahref="#draw">draw</a>().
<p>Reimplemented in <ahref="qcanvasrectangle.html#drawShape">TQCanvasRectangle</a>, <ahref="qcanvaspolygon.html#drawShape">TQCanvasPolygon</a>, and <ahref="qcanvasellipse.html#drawShape">TQCanvasEllipse</a>.
<p>Reimplemented in <ahref="tqcanvasrectangle.html#drawShape">TQCanvasRectangle</a>, <ahref="tqcanvaspolygon.html#drawShape">TQCanvasPolygon</a>, and <ahref="tqcanvasellipse.html#drawShape">TQCanvasEllipse</a>.
<p><p>See also <ahref="qcanvasitem.html#rtti">TQCanvasItem::rtti</a>().
<p><p>See also <ahref="tqcanvasitem.html#rtti">TQCanvasItem::rtti</a>().
<p>Reimplemented from <ahref="qcanvasitem.html#rtti">TQCanvasItem</a>.
<p>Reimplemented in <ahref="qcanvasrectangle.html#rtti">TQCanvasRectangle</a>, <ahref="qcanvaspolygon.html#rtti">TQCanvasPolygon</a>, <ahref="qcanvasline.html#rtti">TQCanvasLine</a>, and <ahref="qcanvasellipse.html#rtti">TQCanvasEllipse</a>.
<p>Reimplemented from <ahref="tqcanvasitem.html#rtti">TQCanvasItem</a>.
<p>Reimplemented in <ahref="tqcanvasrectangle.html#rtti">TQCanvasRectangle</a>, <ahref="tqcanvaspolygon.html#rtti">TQCanvasPolygon</a>, <ahref="tqcanvasline.html#rtti">TQCanvasLine</a>, and <ahref="tqcanvasellipse.html#rtti">TQCanvasEllipse</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasRectangle</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvasrectangle.html">TQCanvasRectangle</a>, including inherited members.
<p> Returns the integer-converted <ahref="qcanvasitem.html#x">x</a>(), <ahref="qcanvasitem.html#y">y</a>() position and <ahref="#size">size</a>() of the
<p> Returns the integer-converted <ahref="tqcanvasitem.html#x">x</a>(), <ahref="tqcanvasitem.html#y">y</a>() position and <ahref="#size">size</a>() of the
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasSpline</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvasspline.html">TQCanvasSpline</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasSprite</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvassprite.html">TQCanvasSprite</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasText</h1>
<p>This is the complete list of member functions for
<ahref="tqcanvastext.html">TQCanvasText</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQCanvasView</h1>
<p>This is the complete list of member functions for
<ahref="qcanvasview.html">TQCanvasView</a>, including inherited members.
<ahref="tqcanvasview.html">TQCanvasView</a>, including inherited members.
: <ahref="qcanvastext.html">TQCanvasText</a>( text, font, canvas ), m_index( index ) {}
: <ahref="tqcanvastext.html">TQCanvasText</a>( text, font, canvas ), m_index( index ) {}
int index() const { return m_index; }
void setIndex( int index ) { m_index = index; }
@ -228,21 +228,21 @@ proportional height ready to draw the next element.
};
</pre>
<p> Our CanvasText subclass is a very simple specialisation of
<ahref="qcanvastext.html">TQCanvasText</a>. All we've done is added a single private member <tt>m_index</tt> which holds the element vector index of the element associated
<ahref="tqcanvastext.html">TQCanvasText</a>. All we've done is added a single private member <tt>m_index</tt> which holds the element vector index of the element associated
with this text item, and provided a getter and setter for this value.
<aname="x2580"></a><ahref="qcanvasitemlist.html">TQCanvasItemList</a> list = <ahref="qcanvasview.html#canvas">canvas</a>()->collisions( e-><ahref="qmouseevent.html#pos">pos</a>() );
<aname="x2580"></a><ahref="tqcanvasitemlist.html">TQCanvasItemList</a> list = <ahref="tqcanvasview.html#canvas">canvas</a>()->collisions( e-><ahref="qmouseevent.html#pos">pos</a>() );
<aname="x2589"></a><aname="x2588"></a> for ( TQCanvasItemList::iterator it = list.<ahref="ntqvaluelist.html#begin">begin</a>(); it != list.<ahref="ntqvaluelist.html#end">end</a>(); ++it )
if ( (*it)->rtti() == CanvasText::CANVAS_TEXT ) {
m_movingItem = *it;
@ -328,7 +328,7 @@ and record its position. Otherwise we set there to be no moving item.
The QCanvas class provides a 2D area that can contain QCanvasItem objects.
The TQCanvas class provides a 2D area that can contain TQCanvasItem objects.
.PP
The QCanvas class manages its 2D graphic area and all the canvas items the area contains. The canvas has no visual appearance of its own. Instead, it is displayed on screen using a QCanvasView. Multiple QCanvasView widgets may be associated with a canvas to provide multiple views of the same canvas.
The TQCanvas class manages its 2D graphic area and all the canvas items the area contains. The canvas has no visual appearance of its own. Instead, it is displayed on screen using a TQCanvasView. Multiple TQCanvasView widgets may be associated with a canvas to provide multiple views of the same canvas.
.PP
The canvas is optimized for large numbers of items, particularly where only a small percentage of the items change at any one time. If the entire display changes very frequently, you should consider using your own custom QScrollView subclass.
.PP
Qt provides a rich set of canvas item classes, e.g. QCanvasEllipse, QCanvasLine, QCanvasPolygon, QCanvasPolygonalItem, QCanvasRectangle, QCanvasSpline, QCanvasSprite and QCanvasText. You can subclass to create your own canvas items; QCanvasPolygonalItem is the most common base class used for this purpose.
Qt provides a rich set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, TQCanvasSprite and TQCanvasText. You can subclass to create your own canvas items; TQCanvasPolygonalItem is the most common base class used for this purpose.
.PP
Items 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. (By default the canvas is white and so are canvas items, so if nothing appears try changing colors.)
.PP
@ -172,13 +172,13 @@ Canvas items are usually much faster to manipulate and redraw than child widgets
It's easy to detect overlapping items (collision detection).
.IP
.TP
The canvas can be larger than a widget. A million-by-million canvas is perfectly possible. At such a size a widget might be very inefficient, and some window systems might not support it at all, whereas QCanvas scales well. Even with a billion pixels and a million items, finding a particular canvas item, detecting collisions, etc., is still fast (though the memory consumption may be prohibitive at such extremes).
The canvas can be larger than a widget. A million-by-million canvas is perfectly possible. At such a size a widget might be very inefficient, and some window systems might not support it at all, whereas TQCanvas scales well. Even with a billion pixels and a million items, finding a particular canvas item, detecting collisions, etc., is still fast (though the memory consumption may be prohibitive at such extremes).
.IP
.TP
Two or more QCanvasView objects can view the same canvas.
Two or more TQCanvasView objects can view the same canvas.
.IP
.TP
An arbitrary transformation matrix can be set on each QCanvasView which makes it easy to zoom, rotate or shear the viewed canvas.
An arbitrary transformation matrix can be set on each TQCanvasView which makes it easy to zoom, rotate or shear the viewed canvas.
.IP
.TP
Widgets provide a lot more functionality, such as input (QKeyEvent, QMouseEvent etc.) and layout management (QGridLayout etc.).
@ -188,19 +188,19 @@ A canvas consists of a background, a number of canvas items organized by x, y an
.PP
The background is white by default, but can be set to a different color using setBackgroundColor(), or to a repeated pixmap using setBackgroundPixmap() or to a mosaic of smaller pixmaps using setTiles(). Individual tiles can be set with setTile(). There are corresponding get functions, e.g. backgroundColor() and backgroundPixmap().
.PP
Note that QCanvas does not inherit from TQWidget, even though it has some functions which provide the same functionality as those in TQWidget. One of these is setBackgroundPixmap(); some others are resize(), size(), width() and height(). QCanvasView is the widget used to display a canvas on the screen.
Note that TQCanvas does not inherit from TQWidget, even though it has some functions which provide the same functionality as those in TQWidget. One of these is setBackgroundPixmap(); some others are resize(), size(), width() and height(). TQCanvasView is the widget used to display a canvas on the screen.
.PP
Canvas 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 QCanvasItem::setCanvas().
Canvas 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 TQCanvasItem::setCanvas().
.PP
Canvas items are movable (and in the case of QCanvasSprites, animated) objects that inherit QCanvasItem. Each canvas item has a position on the canvas (x, y coordinates) and a height (z coordinate), all of which are held as floating-point numbers. Moving canvas items also have x and y velocities. It's possible for a canvas item to be outside the canvas (for example QCanvasItem::x() is greater than width()). When a canvas item is off the canvas, onCanvas() returns FALSE and the canvas disregards the item. (Canvas items off the canvas do not slow down any of the common operations on the canvas.)
Canvas items are movable (and in the case of TQCanvasSprites, animated) objects that inherit TQCanvasItem. Each canvas item has a position on the canvas (x, y coordinates) and a height (z coordinate), all of which are held as floating-point numbers. Moving canvas items also have x and y velocities. It's possible for a canvas item to be outside the canvas (for example TQCanvasItem::x() is greater than width()). When a canvas item is off the canvas, onCanvas() returns FALSE and the canvas disregards the item. (Canvas items off the canvas do not slow down any of the common operations on the canvas.)
.PP
Canvas items can be moved with QCanvasItem::move(). The advance() function moves all QCanvasItem::animated() canvas items and setAdvancePeriod() makes QCanvas move them automatically on a periodic basis. In the context of the QCanvas classes, to `animate' a canvas item is to set it in motion, i.e. using QCanvasItem::setVelocity(). Animation of a canvas item itself, i.e. items which change over time, is enabled by calling QCanvasSprite::setFrameAnimation(), or more generally by subclassing and reimplementing QCanvasItem::advance(). To detect collisions use one of the QCanvasItem::collisions() functions.
Canvas items can be moved with TQCanvasItem::move(). The advance() function moves all TQCanvasItem::animated() canvas items and setAdvancePeriod() makes TQCanvas move them automatically on a periodic basis. In the context of the TQCanvas classes, to `animate' a canvas item is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation of a canvas item itself, i.e. items which change over time, is enabled by calling TQCanvasSprite::setFrameAnimation(), or more generally by subclassing and reimplementing TQCanvasItem::advance(). To detect collisions use one of the TQCanvasItem::collisions() functions.
.PP
The changed parts of the canvas are redrawn (if they are visible in a canvas view) whenever update() is called. You can either call update() manually after having changed the contents of the canvas, or force periodic updates using setUpdatePeriod(). If you have moving objects on the canvas, you must call advance() every time the objects should move one step further. Periodic calls to advance() can be forced using setAdvancePeriod(). The advance() function will call QCanvasItem::advance() on every item that is animated and trigger an update of the affected areas afterwards. (A canvas item that is `animated' is simply a canvas item that is in motion.)
The changed parts of the canvas are redrawn (if they are visible in a canvas view) whenever update() is called. You can either call update() manually after having changed the contents of the canvas, or force periodic updates using setUpdatePeriod(). If you have moving objects on the canvas, you must call advance() every time the objects should move one step further. Periodic calls to advance() can be forced using setAdvancePeriod(). The advance() function will call TQCanvasItem::advance() on every item that is animated and trigger an update of the affected areas afterwards. (A canvas item that is `animated' is simply a canvas item that is in motion.)
.PP
QCanvas organizes its canvas items into \fIchunks\fR; these are areas on the canvas that are used to speed up most operations. Many operations start by eliminating most chunks (i.e. those which haven't changed) and then process only the canvas items that are in the few interesting (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on the canvas.
TQCanvas organizes its canvas items into \fIchunks\fR; these are areas on the canvas that are used to speed up most operations. Many operations start by eliminating most chunks (i.e. those which haven't changed) and then process only the canvas items that are in the few interesting (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on the canvas.
.PP
The chunk size is a key factor to QCanvas's speed: if there are too many chunks, the speed benefit of grouping canvas items into chunks is reduced. If the chunks are too large, it takes too long to process each one. The QCanvas constructor tries to pick a suitable size, but you can call retune() to change it at any time. The chunkSize() function returns the current chunk size. The canvas items always make sure they're in the right chunks; all you need to make sure of is that the canvas uses the right chunk size. A good rule of thumb is that the size should be a bit smaller than the average canvas item size. If you have moving objects, the chunk size should be a bit smaller than the average size of the moving items.
The chunk size is a key factor to TQCanvas's speed: if there are too many chunks, the speed benefit of grouping canvas items into chunks is reduced. If the chunks are too large, it takes too long to process each one. The TQCanvas constructor tries to pick a suitable size, but you can call retune() to change it at any time. The chunkSize() function returns the current chunk size. The canvas items always make sure they're in the right chunks; all you need to make sure of is that the canvas uses the right chunk size. A good rule of thumb is that the size should be a bit smaller than the average canvas item size. If you have moving objects, the chunk size should be a bit smaller than the average size of the moving items.
.PP
The foreground is normally nothing, but if you reimplement drawForeground(), you can draw things in front of all the canvas items.
.PP
@ -210,18 +210,18 @@ An area can be copied (painted) to a QPainter with drawArea().
.PP
If the canvas is resized it emits the resized() signal.
.PP
The examples/canvas application and the 2D graphics page of the examples/demo application demonstrate many of QCanvas's facilities.
The examples/canvas application and the 2D graphics page of the examples/demo application demonstrate many of TQCanvas's facilities.
.PP
See also QCanvasView, QCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes.
See also TQCanvasView, TQCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes.
Create a TQCanvas with no size. \fIparent\fR and \fIname\fR are passed to the TQObject superclass.
.PP
\fBWarning:\fR You \fImust\fR call resize() at some time after creation to be able to use the canvas.
.SH "QCanvas::QCanvas ( int w, int h )"
Constructs a QCanvas that is \fIw\fR pixels wide and \fIh\fR pixels high.
.SH "QCanvas::QCanvas ( QPixmap p, int h, int v, int tilewidth, int tileheight )"
Constructs a QCanvas which will be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels taken from pixmap \fIp\fR.
.SH "TQCanvas::TQCanvas ( int w, int h )"
Constructs a TQCanvas that is \fIw\fR pixels wide and \fIh\fR pixels high.
.SH "TQCanvas::TQCanvas ( QPixmap p, int h, int v, int tilewidth, int tileheight )"
Constructs a TQCanvas which will be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels taken from pixmap \fIp\fR.
.PP
The pixmap \fIp\fR is a list of tiles, arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g.
.PP
@ -232,48 +232,48 @@ l - l. 0 1 2 3 4 5 6
.fi
</center>
.PP
The QCanvas is initially sized to show exactly the given number of tiles horizontally and vertically. If it is resized to be larger, the entire matrix of tiles will be repeated as often as necessary to cover the area. If it is smaller, tiles to the right and bottom will not be visible.
The TQCanvas is initially sized to show exactly the given number of tiles horizontally and vertically. If it is resized to be larger, the entire matrix of tiles will be repeated as often as necessary to cover the area. If it is smaller, tiles to the right and bottom will not be visible.
.PP
See also setTiles().
.SH "QCanvas::~QCanvas ()\fC [virtual]\fR"
.SH "TQCanvas::~TQCanvas ()\fC [virtual]\fR"
Destroys the canvas and all the canvas's canvas items.
Moves all QCanvasItem::animated() canvas items on the canvas and refreshes all changes to all views of the canvas. (An `animated' item is an item that is in motion; see setVelocity().)
Moves all TQCanvasItem::animated() canvas items on the canvas and refreshes all changes to all views of the canvas. (An `animated' item is an item that is in motion; see setVelocity().)
.PP
The advance takes place in two phases. In phase 0, the QCanvasItem::advance() function of each QCanvasItem::animated() canvas item is called with paramater 0. Then all these canvas items are called again, with parameter 1. In phase 0, the canvas items should not change position, merely examine other items on the canvas for which special processing is required, such as collisions between items. In phase 1, all canvas items should change positions, ignoring any other items on the canvas. This two-phase approach allows for considerations of "fairness", although no QCanvasItem subclasses supplied with TQt do anything interesting in phase 0.
The advance takes place in two phases. In phase 0, the TQCanvasItem::advance() function of each TQCanvasItem::animated() canvas item is called with paramater 0. Then all these canvas items are called again, with parameter 1. In phase 0, the canvas items should not change position, merely examine other items on the canvas for which special processing is required, such as collisions between items. In phase 1, all canvas items should change positions, ignoring any other items on the canvas. This two-phase approach allows for considerations of "fairness", although no TQCanvasItem subclasses supplied with TQt do anything interesting in phase 0.
.PP
The canvas can be configured to call this function periodically with setAdvancePeriod().
.PP
See also update().
.SH "QCanvasItemList QCanvas::allItems ()"
.SH "TQCanvasItemList TQCanvas::allItems ()"
Returns a list of all the items in the canvas.
.SH "TQColor QCanvas::backgroundColor () const"
.SH "TQColor TQCanvas::backgroundColor () const"
Returns the color set by setBackgroundColor(). By default, this is white.
.PP
This function is not a reimplementation of TQWidget::backgroundColor() (QCanvas is not a subclass of TQWidget), but all QCanvasViews that are viewing the canvas will set their backgrounds to this color.
This function is not a reimplementation of TQWidget::backgroundColor() (TQCanvas is not a subclass of TQWidget), but all TQCanvasViews that are viewing the canvas will set their backgrounds to this color.
.PP
See also setBackgroundColor() and backgroundPixmap().
.SH "QPixmap QCanvas::backgroundPixmap () const"
.SH "QPixmap TQCanvas::backgroundPixmap () const"
Returns the pixmap set by setBackgroundPixmap(). By default, this is a null pixmap.
.PP
See also setBackgroundPixmap() and backgroundColor().
.SH "int QCanvas::chunkSize () const"
.SH "int TQCanvas::chunkSize () const"
Returns the chunk size of the canvas.
.PP
See also retune().
.SH "QCanvasItemList QCanvas::collisions ( const QPoint & p ) const"
.SH "TQCanvasItemList TQCanvas::collisions ( const QPoint & p ) const"
Returns a list of canvas items that collide with the point \fIp\fR. The list is ordered by z coordinates, from highest z coordinate (front-most item) to lowest z coordinate (rear-most item).
.SH "QCanvasItemList QCanvas::collisions ( const QRect & r ) const"
.SH "TQCanvasItemList TQCanvas::collisions ( const QRect & r ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a list of items which collide with the rectangle \fIr\fR. The list is ordered by z coordinates, from highest z coordinate (front-most item) to lowest z coordinate (rear-most item).
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a list of canvas items which intersect with the chunks listed in \fIchunklist\fR, excluding \fIitem\fR. If \fIexact\fR is TRUE, only those which actually collide with \fIitem\fR are returned; otherwise canvas items are included just for being in the chunks.
.PP
This is a utility function mainly used to implement the simpler QCanvasItem::collisions() function.
This virtual function is called for all updates of the canvas. It renders any background graphics using the painter \fIpainter\fR, in the area \fIclip\fR. If the canvas has a background pixmap or a tiled background, that graphic is used, otherwise the canvas is cleared using the background color.
.PP
If the graphics for an area change, you must explicitly call setChanged(const QRect&) for the result to be visible when update() is next called.
.PP
See also setBackgroundColor(), setBackgroundPixmap(), and setTiles().
This virtual function is called for all updates of the canvas. It renders any foreground graphics using the painter \fIpainter\fR, in the area \fIclip\fR.
.PP
If the graphics for an area change, you must explicitly call setChanged(const QRect&) for the result to be visible when update() is next called.
.PP
The default is to draw nothing.
.SH "int QCanvas::height () const"
.SH "int TQCanvas::height () const"
Returns the height of the canvas, in pixels.
.PP
Example: canvas/canvas.cpp.
.SH "bool QCanvas::onCanvas ( int x, int y ) const"
.SH "bool TQCanvas::onCanvas ( int x, int y ) const"
Returns TRUE if the pixel position (\fIx\fR, \fIy\fR) is on the canvas; otherwise returns FALSE.
.PP
See also validChunk().
.SH "bool QCanvas::onCanvas ( const QPoint & p ) const"
.SH "bool TQCanvas::onCanvas ( const QPoint & p ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the pixel position \fIp\fR is on the canvas; otherwise returns FALSE.
.PP
See also validChunk().
.SH "QRect QCanvas::rect () const"
.SH "QRect TQCanvas::rect () const"
Returns a rectangle the size of the canvas.
.SH "void QCanvas::resize ( int w, int h )\fC [virtual]\fR"
.SH "void TQCanvas::resize ( int w, int h )\fC [virtual]\fR"
Changes the size of the canvas to have a width of \fIw\fR and a height of \fIh\fR. This is a slow operation.
.PP
Examples:
.)l canvas/canvas.cpp and chart/chartform.cpp.
.SH "void QCanvas::resized ()\fC [signal]\fR"
This signal is emitted whenever the canvas is resized. Each QCanvasView connects to this signal to keep the scrollview's size correct.
.SH "void QCanvas::retune ( int chunksze, int mxclusters = 100 )\fC [virtual]\fR"
.SH "void TQCanvas::resized ()\fC [signal]\fR"
This signal is emitted whenever the canvas is resized. Each TQCanvasView connects to this signal to keep the scrollview's size correct.
.SH "void TQCanvas::retune ( int chunksze, int mxclusters = 100 )\fC [virtual]\fR"
Change the efficiency tuning parameters to \fImxclusters\fR clusters, each of size \fIchunksze\fR. This is a slow operation if there are many objects on the canvas.
.PP
The canvas is divided into chunks which are rectangular areas \fIchunksze\fR wide by \fIchunksze\fR high. Use a chunk size which is about the average size of the canvas items. If you choose a chunk size which is too small it will increase the amount of calculation required when drawing since each change will affect many chunks. If you choose a chunk size which is too large the amount of drawing required will increase because for each change, a lot of drawing will be required since there will be many (unchanged) canvas items which are in the same chunk as the changed canvas items.
@ -336,31 +336,31 @@ The canvas is divided into chunks which are rectangular areas \fIchunksze\fR wid
Internally, a canvas uses a low-resolution "chunk matrix" to keep track of all the items in the canvas. A 64x64 chunk matrix is the default for a 1024x1024 pixel canvas, where each chunk collects canvas items in a 16x16 pixel square. This default is also affected by setTiles(). You can tune this default using this function. For example if you have a very large canvas and want to trade off speed for memory then you might set the chunk size to 32 or 64.
.PP
The \fImxclusters\fR argument is the number of rectangular groups of chunks that will be separately drawn. If the canvas has a large number of small, dispersed items, this should be about that number. Our testing suggests that a large number of clusters is almost always best.
.SH "void QCanvas::setAdvancePeriod ( int ms )\fC [virtual]\fR"
.SH "void TQCanvas::setAdvancePeriod ( int ms )\fC [virtual]\fR"
Sets the canvas to call advance() every \fIms\fR milliseconds. Any previous setting by setAdvancePeriod() or setUpdatePeriod() is overridden.
.PP
If \fIms\fR is less than 0 advancing will be stopped.
Marks the whole canvas as changed. All views of the canvas will be entirely redrawn when update() is called next.
.SH "void QCanvas::setBackgroundColor ( const TQColor & c )\fC [virtual]\fR"
.SH "void TQCanvas::setBackgroundColor ( const TQColor & c )\fC [virtual]\fR"
Sets the solid background to be the color \fIc\fR.
.PP
See also backgroundColor(), setBackgroundPixmap(), and setTiles().
.SH "void QCanvas::setBackgroundPixmap ( const QPixmap & p )\fC [virtual]\fR"
.SH "void TQCanvas::setBackgroundPixmap ( const QPixmap & p )\fC [virtual]\fR"
Sets the solid background to be the pixmap \fIp\fR repeated as necessary to cover the entire canvas.
.PP
See also backgroundPixmap(), setBackgroundColor(), and setTiles().
.SH "void QCanvas::setChanged ( const QRect & area )\fC [virtual]\fR"
.SH "void TQCanvas::setChanged ( const QRect & area )\fC [virtual]\fR"
Marks \fIarea\fR as changed. This \fIarea\fR will be redrawn in all views that are showing it when update() is called next.
.SH "void QCanvas::setDoubleBuffering ( bool y )\fC [virtual]\fR"
.SH "void TQCanvas::setDoubleBuffering ( bool y )\fC [virtual]\fR"
If \fIy\fR is TRUE (the default) double-buffering is switched on; otherwise double-buffering is switched off.
.PP
Turning off double-buffering causes the redrawn areas to flicker a little and also gives a (usually small) performance improvement.
.PP
Example: canvas/canvas.cpp.
.SH "void QCanvas::setTile ( int x, int y, int tilenum )\fC [virtual]\fR"
.SH "void TQCanvas::setTile ( int x, int y, int tilenum )\fC [virtual]\fR"
Sets the tile at (\fIx\fR, \fIy\fR) to use tile number \fItilenum\fR, which is an index into the tile pixmaps. The canvas will update appropriately when update() is next called.
.PP
The images are taken from the pixmap set by setTiles() and are arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g.
@ -373,8 +373,8 @@ l - l. 0 1 2 3 4 5 6
</center>
.PP
See also tile() and setTiles().
.SH "void QCanvas::setTiles ( QPixmap p, int h, int v, int tilewidth, int tileheight )\fC [virtual]\fR"
Sets the QCanvas to be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels from pixmap \fIp\fR.
.SH "void TQCanvas::setTiles ( QPixmap p, int h, int v, int tilewidth, int tileheight )\fC [virtual]\fR"
Sets the TQCanvas to be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels from pixmap \fIp\fR.
.PP
The pixmap \fIp\fR is a list of tiles, arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g.
.PP
@ -390,49 +390,49 @@ If the canvas is larger than the matrix of tiles, the entire matrix is repeated
The width and height of \fIp\fR must be a multiple of \fItilewidth\fR and \fItileheight\fR. If they are not the function will do nothing.
.PP
If you want to unset any tiling set, then just pass in a null pixmap and 0 for \fIh\fR, \fIv\fR, \fItilewidth\fR, and \fItileheight\fR.
.SH "void QCanvas::setUnchanged ( const QRect & area )\fC [virtual]\fR"
.SH "void TQCanvas::setUnchanged ( const QRect & area )\fC [virtual]\fR"
Marks \fIarea\fR as \fIunchanged\fR. The area will \fInot\fR be redrawn in the views for the next update(), unless it is marked or changed again before the next call to update().
.SH "void QCanvas::setUpdatePeriod ( int ms )\fC [virtual]\fR"
.SH "void TQCanvas::setUpdatePeriod ( int ms )\fC [virtual]\fR"
Sets the canvas to call update() every \fIms\fR milliseconds. Any previous setting by setAdvancePeriod() or setUpdatePeriod() is overridden.
.PP
If \fIms\fR is less than 0 automatic updating will be stopped.
.SH "QSize QCanvas::size () const"
.SH "QSize TQCanvas::size () const"
Returns the size of the canvas, in pixels.
.SH "int QCanvas::tile ( int x, int y ) const"
.SH "int TQCanvas::tile ( int x, int y ) const"
Returns the tile at position (\fIx\fR, \fIy\fR). Initially, all tiles are 0.
.PP
The parameters must be within range, i.e. 0 < \fIx\fR < tilesHorizontally() and 0 < \fIy\fR < tilesVertically().
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,25 +7,25 @@
.ad l
.nh
.SH NAME
QCanvasEllipse \- Ellipse or ellipse segment on a QCanvas
TQCanvasEllipse \- Ellipse or ellipse segment on a TQCanvas
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
\fC#include <tqcanvas.h>\fR
.PP
Inherits QCanvasPolygonalItem.
Inherits TQCanvasPolygonalItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCanvasEllipse\fR ( QCanvas * canvas )"
.BI "\fBTQCanvasEllipse\fR ( TQCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasEllipse\fR ( int width, int height, QCanvas * canvas )"
.BI "\fBTQCanvasEllipse\fR ( int width, int height, TQCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasEllipse\fR ( int width, int height, int startangle, int angle, QCanvas * canvas )"
.BI "\fBTQCanvasEllipse\fR ( int width, int height, int startangle, int angle, TQCanvas * canvas )"
.br
.ti -1c
.BI "\fB~QCanvasEllipse\fR ()"
.BI "\fB~TQCanvasEllipse\fR ()"
.br
.ti -1c
.BI "int \fBwidth\fR () const"
@ -56,7 +56,7 @@ Inherits QCanvasPolygonalItem.
.br
.in -1c
.SH DESCRIPTION
The QCanvasEllipse class provides an ellipse or ellipse segment on a QCanvas.
The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas.
.PP
A canvas item that paints an ellipse or ellipse segment with a QBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime with setSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) with setAngles().
.PP
@ -74,53 +74,53 @@ The ellipse can be drawn on a painter with drawShape().
.PP
Like any other canvas item ellipses can be moved with move() and moveBy(), or by setting coordinates with setX(), setY() and setZ().
.PP
Note: QCanvasEllipse does not use the pen.
Note: TQCanvasEllipse does not use the pen.
.PP
See also Graphics Classes and Image Processing Classes.
Constructs a 32x32 ellipse, centered at (0, 0) on \fIcanvas\fR.
.SH "QCanvasEllipse::QCanvasEllipse ( int width, int height, QCanvas * canvas )"
.SH "TQCanvasEllipse::TQCanvasEllipse ( int width, int height, TQCanvas * canvas )"
Constructs a \fIwidth\fR by \fIheight\fR pixel ellipse, centered at (0, 0) on \fIcanvas\fR.
.SH "QCanvasEllipse::QCanvasEllipse ( int width, int height, int startangle, int angle, QCanvas * canvas )"
.SH "TQCanvasEllipse::TQCanvasEllipse ( int width, int height, int startangle, int angle, TQCanvas * canvas )"
Constructs a \fIwidth\fR by \fIheight\fR pixel ellipse, centered at (0, 0) on \fIcanvas\fR. Only a segment of the ellipse is drawn, starting at angle \fIstartangle\fR, and extending for angle \fIangle\fR (the angle length).
.PP
Note that angles are specified in <small><sup>1</sup>/<sub>16</sub></small>ths of a degree.
.SH "QCanvasEllipse::~QCanvasEllipse ()"
.SH "TQCanvasEllipse::~TQCanvasEllipse ()"
Destroys the ellipse.
.SH "int QCanvasEllipse::angleLength () const"
.SH "int TQCanvasEllipse::angleLength () const"
Returns the length angle (the extent of the ellipse segment) in 16ths of a degree. Initially this will be 360 * 16 (a complete ellipse).
.PP
See also setAngles() and angleStart().
.SH "int QCanvasEllipse::angleStart () const"
.SH "int TQCanvasEllipse::angleStart () const"
Returns the start angle in 16ths of a degree. Initially this will be 0.
.PP
See also setAngles() and angleLength().
.SH "void QCanvasEllipse::drawShape ( QPainter & p )\fC [virtual protected]\fR"
.SH "void TQCanvasEllipse::drawShape ( QPainter & p )\fC [virtual protected]\fR"
Draws the ellipse, centered at x(), y() using the painter \fIp\fR.
.PP
Note that QCanvasEllipse does not support an outline (the pen is always NoPen).
Note that TQCanvasEllipse does not support an outline (the pen is always NoPen).
.SH "void QCanvasEllipse::setAngles ( int start, int length )"
Reimplemented from TQCanvasPolygonalItem.
.SH "void TQCanvasEllipse::setAngles ( int start, int length )"
Sets the angles for the ellipse. The start angle is \fIstart\fR and the extent of the segment is \fIlength\fR (the angle length) from the \fIstart\fR. The angles are specified in 16ths of a degree. By default the ellipse will start at 0 and have an angle length of 360 * 16 (a complete ellipse).
.PP
See also angleStart() and angleLength().
.SH "void QCanvasEllipse::setSize ( int width, int height )"
.SH "void TQCanvasEllipse::setSize ( int width, int height )"
Sets the \fIwidth\fR and \fIheight\fR of the ellipse.
.SH "int QCanvasEllipse::width () const"
.SH "int TQCanvasEllipse::width () const"
Returns the width of the ellipse.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcanvasellipse.html
.BR http://doc.trolltech.com/tqcanvasellipse.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
@ -148,95 +148,95 @@ Inherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText.
.br
.in -1c
.SH DESCRIPTION
The QCanvasItem class provides an abstract graphic object on a QCanvas.
The TQCanvasItem class provides an abstract graphic object on a TQCanvas.
.PP
A 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.
A variety of TQCanvasItem 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. TQCanvasItem is not intended for direct subclassing. It is much easier to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse or TQCanvasText.
.PP
Canvas 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().
.PP
Items 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(). Since the canvas background defaults to white and canvas items default to white, you may need to change colors to see your items.
.PP
A 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.
A TQCanvasItem 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.
.PP
Use QCanvasSprite or your own subclass of QCanvasSprite to create canvas items which are animated, i.e. which change over time.
Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas items which are animated, i.e. which change over time.
.PP
The 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.
.PP
The rtti() function is used for identifying subclasses of QCanvasItem. The canvas() function returns a pointer to the canvas which contains the canvas item.
The rtti() function is used for identifying subclasses of TQCanvasItem. The canvas() function returns a pointer to the canvas which contains the canvas item.
.PP
QCanvasItem provides the show() and isVisible() functions like those in TQWidget.
TQCanvasItem provides the show() and isVisible() functions like those in TQWidget.
.PP
QCanvasItem 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.
TQCanvasItem 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 TQCanvasItem itself. You can make use of these booleans in your subclasses.
.PP
By default, canvas items have no velocity, no size, and are not in motion. The subclasses provided in TQt do not change these defaults except where noted.
.PP
See also Graphics Classes and Image Processing Classes.
.SS "Member Type Documentation"
.SH "QCanvasItem::RttiValues"
.SH "TQCanvasItem::RttiValues"
This enum is used to name the different types of canvas item.
.TP
\fCQCanvasItem::Rtti_Item\fR - Canvas item abstract base class
\fCTQCanvasItem::Rtti_Item\fR - Canvas item abstract base class
Destroys the TQCanvasItem and removes it from its canvas.
.SH "bool TQCanvasItem::active () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Use isActive() instead.
.SH "void QCanvasItem::advance ( int phase )\fC [virtual]\fR"
.SH "void TQCanvasItem::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.
.PP
Note 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.
.PP
See also QCanvas::advance() and setVelocity().
See also TQCanvas::advance() and setVelocity().
.PP
Example: canvas/canvas.cpp.
.PP
Reimplemented in QCanvasSprite.
.SH "bool QCanvasItem::animated () const"
Reimplemented in TQCanvasSprite.
.SH "bool TQCanvasItem::animated () const"
Returns TRUE if the canvas item is in motion; otherwise returns FALSE.
Returns TRUE if the canvas item will collide with the \fIother\fR item \fIafter\fR they have moved by their current velocities; otherwise returns FALSE.
Returns the list of canvas items that this canvas item has collided with.
.PP
A collision is generally defined as occurring when the pixels of one item draw on the pixels of another item, but not all subclasses are so precise. Also, since pixel-wise collision detection can be slow, this function works in either exact or inexact mode, according to the \fIexact\fR parameter.
@ -245,57 +245,57 @@ If \fIexact\fR is TRUE, the canvas items returned have been accurately tested fo
.PP
If \fIexact\fR is FALSE, the canvas items returned are \fInear\fR the canvas item. You can test the canvas items returned using collidesWith() if any are interesting collision candidates. By using this approach, you can ignore some canvas items for which collisions are not relevant.
.PP
The returned list is a list of QCanvasItems, but often you will need to cast the items to their subclass types. The safe way to do this is to use rtti() before casting. This provides some of the functionality of the standard C++ dynamic cast operation even on compilers where dynamic casts are not available.
The returned list is a list of TQCanvasItems, but often you will need to cast the items to their subclass types. The safe way to do this is to use rtti() before casting. This provides some of the functionality of the standard C++ dynamic cast operation even on compilers where dynamic casts are not available.
.PP
Note that a canvas item may be `on' a canvas, e.g. it was created with the canvas as parameter, even though its coordinates place it beyond the edge of the canvas's area. Collision detection only works for canvas items which are wholly or partly within the canvas's area.
.PP
Note that if items have a velocity (see setVelocity()), then collision testing is done based on where the item \fIwill\fR be when it moves, not its current location. For example, a "ball" item doesn't need to actually embed into a "wall" item before a collision is detected. For items without velocity, plain intersection is used.
This abstract virtual function draws the canvas item using \fIpainter\fR.
.PP
\fBWarning:\fR When you reimplement this function, make sure that you leave the painter in the same state as you found it. For example, if you start by calling QPainter::translate(50, 50), end your code by calling QPainter::translate(-50, -50). Be also aware that the painter might already have some transformations set (i.e., don't call QPainter::resetXForm() when you're done).
.PP
Reimplemented in QCanvasSprite, QCanvasPolygonalItem, and QCanvasText.
.SH "bool QCanvasItem::enabled () const"
Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText.
.SH "bool TQCanvasItem::enabled () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Use isEnabled() instead.
.SH "void QCanvasItem::hide ()"
.SH "void TQCanvasItem::hide ()"
Shorthand for setVisible(FALSE).
.SH "bool QCanvasItem::isActive () const"
Returns TRUE if the QCanvasItem is active; otherwise returns FALSE.
.SH "bool QCanvasItem::isEnabled () const"
Returns TRUE if the QCanvasItem is enabled; otherwise returns FALSE.
.SH "bool QCanvasItem::isSelected () const"
.SH "bool TQCanvasItem::isActive () const"
Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE.
.SH "bool TQCanvasItem::isEnabled () const"
Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE.
.SH "bool TQCanvasItem::isSelected () const"
Returns TRUE if the canvas item is selected; otherwise returns FALSE.
.SH "bool QCanvasItem::isVisible () const"
.SH "bool TQCanvasItem::isVisible () const"
Returns TRUE if the canvas item is visible; otherwise returns FALSE.
.PP
Note that in this context TRUE does \fInot\fR mean that the canvas item is currently in a view, merely that if a view is showing the area where the canvas item is positioned, and the item is not obscured by items with higher z values, and the view is not obscured by overlaying windows, it would be visible.
.PP
See also setVisible() and z().
.SH "void QCanvasItem::move ( double x, double y )"
.SH "void TQCanvasItem::move ( double x, double y )"
Moves the canvas item to the absolute position (\fIx\fR, \fIy\fR).
.PP
Example: canvas/canvas.cpp.
.SH "void QCanvasItem::moveBy ( double dx, double dy )\fC [virtual]\fR"
.SH "void TQCanvasItem::moveBy ( double dx, double dy )\fC [virtual]\fR"
Moves the canvas item relative to its current position by (\fIdx\fR, \fIdy\fR).
Make your derived classes return their own values for rtti(), so that you can distinguish between objects returned by QCanvas::at(). You should use values greater than 1000 to allow for extensions to this class.
Make your derived classes return their own values for rtti(), so that you can distinguish between objects returned by TQCanvas::at(). You should use values greater than 1000 to allow for extensions to this class.
.PP
Overuse of this functionality can damage it's extensibility. For example, once you have identified a base class of a QCanvasItem found by QCanvas::at(), cast it to that type and call meaningful methods rather than acting upon the object based on its rtti value.
Overuse of this functionality can damage it's extensibility. For example, once you have identified a base class of a TQCanvasItem found by TQCanvas::at(), cast it to that type and call meaningful methods rather than acting upon the object based on its rtti value.
.PP
For example:
.PP
.nf
.br
QCanvasItem* item;
TQCanvasItem* item;
.br
// Find an item, e.g. with QCanvasItem::collisions().
// Find an item, e.g. with TQCanvasItem::collisions().
.br
...
.br
@ -315,93 +315,93 @@ For example:
.PP
Example: canvas/canvas.cpp.
.PP
Reimplemented in QCanvasSprite, QCanvasPolygonalItem, and QCanvasText.
.SH "bool QCanvasItem::selected () const"
Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText.
.SH "bool TQCanvasItem::selected () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
Sets the active flag of the item to \fIyes\fR. If this changes the item's active state the item will be redrawn when TQCanvas::update() is next called.
.PP
The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setActive() function is supplied because many applications need it, but it is up to you how you use the isActive() value.
.SH "void QCanvasItem::setAnimated ( bool y )\fC [virtual]\fR"
The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setActive() function is supplied because many applications need it, but it is up to you how you use the isActive() value.
.SH "void TQCanvasItem::setAnimated ( bool y )\fC [virtual]\fR"
Sets the canvas item to be in motion if \fIy\fR is TRUE, or not if \fIy\fR is FALSE. The speed and direction of the motion is set with setVelocity(), or with setXVelocity() and setYVelocity().
.PP
See also advance() and QCanvas::advance().
.SH "void QCanvasItem::setCanvas ( QCanvas * c )\fC [virtual]\fR"
Sets the QCanvas upon which the canvas item is to be drawn to \fIc\fR.
See also advance() and TQCanvas::advance().
.SH "void TQCanvasItem::setCanvas ( TQCanvas * c )\fC [virtual]\fR"
Sets the TQCanvas upon which the canvas item is to be drawn to \fIc\fR.
Sets the enabled flag of the item to \fIyes\fR. If this changes the item's enabled state the item will be redrawn when QCanvas::update() is next called.
Sets the enabled flag of the item to \fIyes\fR. If this changes the item's enabled state the item will be redrawn when TQCanvas::update() is next called.
.PP
The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setEnabled() function is supplied because many applications need it, but it is up to you how you use the isEnabled() value.
Sets the selected flag of the item to \fIyes\fR. If this changes the item's selected state the item will be redrawn when QCanvas::update() is next called.
The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setEnabled() function is supplied because many applications need it, but it is up to you how you use the isEnabled() value.
Sets the selected flag of the item to \fIyes\fR. If this changes the item's selected state the item will be redrawn when TQCanvas::update() is next called.
.PP
The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setSelected() function is supplied because many applications need it, but it is up to you how you use the isSelected() value.
The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setSelected() function is supplied because many applications need it, but it is up to you how you use the isSelected() value.
Makes the canvas item visible if \fIyes\fR is TRUE, or invisible if \fIyes\fR is FALSE. The change takes effect when TQCanvas::update() is next called.
.SH "void TQCanvasItem::setX ( double x )"
Moves the canvas item so that its x-position is \fIx\fR.
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,32 +7,32 @@
.ad l
.nh
.SH NAME
QCanvasItemList \- List of QCanvasItems
TQCanvasItemList \- List of TQCanvasItems
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
\fC#include <tqcanvas.h>\fR
.PP
Inherits QValueList<QCanvasItem * >.
Inherits QValueList<TQCanvasItem * >.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "QCanvasItemList \fBoperator+\fR ( const QCanvasItemList & l ) const"
.BI "TQCanvasItemList \fBoperator+\fR ( const TQCanvasItemList & l ) const"
.br
.in -1c
.SH DESCRIPTION
The QCanvasItemList class is a list of QCanvasItems.
The TQCanvasItemList class is a list of TQCanvasItems.
.PP
QCanvasItemList is a QValueList of pointers to QCanvasItems. This class is used by some methods in QCanvas that need to return a list of canvas items.
TQCanvasItemList is a QValueList of pointers to TQCanvasItems. This class is used by some methods in TQCanvas that need to return a list of canvas items.
.PP
The QValueList documentation describes how to use this list.
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasItemList QCanvasItemList::operator+ ( const QCanvasItemList & l ) const"
.SH "TQCanvasItemList TQCanvasItemList::operator+ ( const TQCanvasItemList & l ) const"
Returns the concatenation of this list and list \fIl\fR.
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,19 +7,19 @@
.ad l
.nh
.SH NAME
QCanvasLine \- Line on a QCanvas
TQCanvasLine \- Line on a TQCanvas
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
\fC#include <tqcanvas.h>\fR
.PP
Inherits QCanvasPolygonalItem.
Inherits TQCanvasPolygonalItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCanvasLine\fR ( QCanvas * canvas )"
.BI "\fBTQCanvasLine\fR ( TQCanvas * canvas )"
.br
.ti -1c
.BI "\fB~QCanvasLine\fR ()"
.BI "\fB~TQCanvasLine\fR ()"
.br
.ti -1c
.BI "void \fBsetPoints\fR ( int xa, int ya, int xb, int yb )"
@ -35,41 +35,41 @@ Inherits QCanvasPolygonalItem.
.br
.in -1c
.SH DESCRIPTION
The QCanvasLine class provides a line on a QCanvas.
The TQCanvasLine class provides a line on a TQCanvas.
.PP
The line inherits functionality from QCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints().
The line inherits functionality from TQCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints().
.PP
Like any other canvas item lines can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item lines can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
The QCanvasPixmap class provides pixmaps for QCanvasSprites.
The TQCanvasPixmap class provides pixmaps for TQCanvasSprites.
.PP
If you want to show a single pixmap on a QCanvas use a QCanvasSprite with just one pixmap.
If you want to show a single pixmap on a TQCanvas use a TQCanvasSprite with just one pixmap.
.PP
When pixmaps are inserted into a QCanvasPixmapArray they are held as QCanvasPixmaps. QCanvasSprites are used to show pixmaps on QCanvases and hold their pixmaps in a QCanvasPixmapArray. If you retrieve a frame (pixmap) from a QCanvasSprite it will be returned as a QCanvasPixmap.
When pixmaps are inserted into a TQCanvasPixmapArray they are held as TQCanvasPixmaps. TQCanvasSprites are used to show pixmaps on TQCanvases and hold their pixmaps in a TQCanvasPixmapArray. If you retrieve a frame (pixmap) from a TQCanvasSprite it will be returned as a TQCanvasPixmap.
.PP
The pixmap is a QPixmap and can only be set in the constructor. There are three different constructors, one taking a QPixmap, one a TQImage and one a file name that refers to a file in any supported file format (see QImageIO).
.PP
QCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a QCanvasPixmap from a PNG file or from a TQImage that has a TQImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the QCanvasPixmap is used in a QCanvasSprite, the offset position is the point at QCanvasItem::x() and QCanvasItem::y(), not the top-left corner of the pixmap.
TQCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a TQCanvasPixmap from a PNG file or from a TQImage that has a TQImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the TQCanvasPixmap is used in a TQCanvasSprite, the offset position is the point at TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of the pixmap.
.PP
Note that for QCanvasPixmap objects created by a QCanvasSprite, the position of each QCanvasPixmap object is set so that the hotspot stays in the same position.
Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the position of each TQCanvasPixmap object is set so that the hotspot stays in the same position.
.PP
See also QCanvasPixmapArray, QCanvasItem, QCanvasSprite, Graphics Classes, and Image Processing Classes.
See also TQCanvasPixmapArray, TQCanvasItem, TQCanvasSprite, Graphics Classes, and Image Processing Classes.
.BI "bool \fBreadPixmaps\fR ( const TQString & filenamepattern, int fc = 0 )"
@ -41,32 +41,32 @@ QCanvasPixmapArray \- Array of QCanvasPixmaps
.BI "bool \fBisValid\fR () const"
.br
.ti -1c
.BI "QCanvasPixmap * \fBimage\fR ( int i ) const"
.BI "TQCanvasPixmap * \fBimage\fR ( int i ) const"
.br
.ti -1c
.BI "void \fBsetImage\fR ( int i, QCanvasPixmap * p )"
.BI "void \fBsetImage\fR ( int i, TQCanvasPixmap * p )"
.br
.ti -1c
.BI "uint \fBcount\fR () const"
.br
.in -1c
.SH DESCRIPTION
The QCanvasPixmapArray class provides an array of QCanvasPixmaps.
The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps.
.PP
This class is used by QCanvasSprite to hold an array of pixmaps. It is used to implement animated sprites, i.e. images that change over time, with each pixmap in the array holding one frame.
This class is used by TQCanvasSprite to hold an array of pixmaps. It is used to implement animated sprites, i.e. images that change over time, with each pixmap in the array holding one frame.
.PP
Depending on the constructor you use you can load multiple pixmaps into the array either from a directory (specifying a wildcard pattern for the files), or from a list of QPixmaps. You can also read in a set of pixmaps after construction using readPixmaps().
.PP
Individual pixmaps can be set with setImage() and retrieved with image(). The number of pixmaps in the array is returned by count().
.PP
QCanvasSprite uses an image's mask for collision detection. You can change this by reading in a separate set of image masks using readCollisionMasks().
TQCanvasSprite uses an image's mask for collision detection. You can change this by reading in a separate set of image masks using readCollisionMasks().
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasPixmapArray::QCanvasPixmapArray ()"
Constructs an invalid array (i.e. isValid() will return FALSE). You must call readPixmaps() before being able to use this QCanvasPixmapArray.
.SH "QCanvasPixmapArray::QCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 )"
Constructs a QCanvasPixmapArray from files.
.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ()"
Constructs an invalid array (i.e. isValid() will return FALSE). You must call readPixmaps() before being able to use this TQCanvasPixmapArray.
.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 )"
Constructs a TQCanvasPixmapArray from files.
.PP
The \fIfc\fR parameter sets the number of frames to be loaded for this image.
.PP
@ -75,43 +75,43 @@ If \fIfc\fR is not 0, \fIdatafilenamepattern\fR should contain "%1", e.g. "foo%1
If \fIfc\fR is 0, \fIdatafilenamepattern\fR is asssumed to be a filename, and the image contained in this file will be loaded as the first (and only) frame.
.PP
If \fIdatafilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, the array ends up empty and isValid() returns FALSE.
Constructs a QCanvasPixmapArray from the list of QPixmaps in the \fIlist\fR. Each pixmap will get a hotspot according to the \fIhotspots\fR array. If no hotspots are specified, each one is set to be at position (0, 0).
Constructs a TQCanvasPixmapArray from the list of QPixmaps \fIlist\fR. The \fIhotspots\fR list has to be of the same size as \fIlist\fR.
Constructs a TQCanvasPixmapArray from the list of QPixmaps in the \fIlist\fR. Each pixmap will get a hotspot according to the \fIhotspots\fR array. If no hotspots are specified, each one is set to be at position (0, 0).
By default, QCanvasSprite uses the image mask of a sprite to detect collisions. Use this function to set your own collision image masks.
By default, TQCanvasSprite uses the image mask of a sprite to detect collisions. Use this function to set your own collision image masks.
.PP
If count() is 1 \fIfilename\fR must specify a real filename to read the mask from. If count() is greater than 1, the \fIfilename\fR must contain a "%1" that will get replaced by the number of the mask to be loaded, just like QCanvasPixmapArray::readPixmaps().
If count() is 1 \fIfilename\fR must specify a real filename to read the mask from. If count() is greater than 1, the \fIfilename\fR must contain a "%1" that will get replaced by the number of the mask to be loaded, just like TQCanvasPixmapArray::readPixmaps().
.PP
All collision masks must be 1-bit images or this function call will fail.
.PP
If the file isn't readable, contains the wrong number of images, or there is some other error, this function will return FALSE, and the array will be flagged as invalid; otherwise this function returns TRUE.
.PP
See also isValid().
.SH "bool QCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 )"
.SH "bool TQCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 )"
Reads one or more pixmaps into the pixmap array.
.PP
If \fIfc\fR is not 0, \fIfilenamepattern\fR should contain "%1", e.g." foo%1.png". The actual filenames are formed by replacing the %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, foo0001.png, foo0002.png, etc.
@ -121,7 +121,7 @@ If \fIfc\fR is 0, \fIfilenamepattern\fR is asssumed to be a filename, and the im
If \fIfilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, this function will return FALSE, and isValid() will return FALSE; otherwise this function will return TRUE.
.PP
See also isValid().
.SH "void QCanvasPixmapArray::setImage ( int i, QCanvasPixmap * p )"
.SH "void TQCanvasPixmapArray::setImage ( int i, TQCanvasPixmap * p )"
Replaces the pixmap at index \fIi\fR with pixmap \fIp\fR.
.PP
The array takes ownership of \fIp\fR and will delete \fIp\fR when the array itself is deleted.
@ -131,7 +131,7 @@ least i+1 elements, with elements count() to i-1 being initialized
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,21 +7,21 @@
.ad l
.nh
.SH NAME
QCanvasPolygon \- Polygon on a QCanvas
TQCanvasPolygon \- Polygon on a TQCanvas
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
\fC#include <tqcanvas.h>\fR
.PP
Inherits QCanvasPolygonalItem.
Inherits TQCanvasPolygonalItem.
.PP
Inherited by QCanvasSpline.
Inherited by TQCanvasSpline.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCanvasPolygon\fR ( QCanvas * canvas )"
.BI "\fBTQCanvasPolygon\fR ( TQCanvas * canvas )"
.br
.ti -1c
.BI "\fB~QCanvasPolygon\fR ()"
.BI "\fB~TQCanvasPolygon\fR ()"
.br
.ti -1c
.BI "void \fBsetPoints\fR ( QPointArray pa )"
@ -43,53 +43,53 @@ Inherited by QCanvasSpline.
.br
.in -1c
.SH DESCRIPTION
The QCanvasPolygon class provides a polygon on a QCanvas.
The TQCanvasPolygon class provides a polygon on a TQCanvas.
.PP
Paints a polygon with a QBrush. The polygon's points can be set in the constructor or set or changed later using setPoints(). Use points() to retrieve the points, or areaPoints() to retrieve the points relative to the canvas's origin.
.PP
The polygon can be drawn on a painter with drawShape().
.PP
Like any other canvas item polygons can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item polygons can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
Note: QCanvasPolygon does not use the pen.
Note: TQCanvasPolygon does not use the pen.
.PP
See also Graphics Classes and Image Processing Classes.
@ -70,97 +70,97 @@ Inherited by QCanvasRectangle, QCanvasPolygon, QCanvasLine, and QCanvasEllipse.
.br
.in -1c
.SH DESCRIPTION
The QCanvasPolygonalItem class provides a polygonal canvas item on a QCanvas.
The TQCanvasPolygonalItem class provides a polygonal canvas item on a TQCanvas.
.PP
The mostly rectangular classes, such as QCanvasSprite and QCanvasText, use the object's bounding rectangle for movement, repainting and collision calculations. For most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, and there are many other cases which are also bad. QCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., which is much faster for non-rectangular items.
The mostly rectangular classes, such as TQCanvasSprite and TQCanvasText, use the object's bounding rectangle for movement, repainting and collision calculations. For most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, and there are many other cases which are also bad. TQCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., which is much faster for non-rectangular items.
.PP
Derived 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.
Derived 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 TQCanvasPolygonalItem's speed.
.PP
Note that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints().
.PP
Normally, QCanvasPolygonalItem uses the odd-even algorithm for determining whether an object intersects this object. You can change this to the winding algorithm using setWinding().
Normally, TQCanvasPolygonalItem uses the odd-even algorithm for determining whether an object intersects this object. You can change this to the winding algorithm using setWinding().
.PP
The 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.
The 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 TQCanvasItem::advance(1) has been called.
.PP
If the shape of the polygonal item is about to change while the item is visible, call invalidate() before updating with a different result from areaPoints().
.PP
By 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.
By default, TQCanvasPolygonalItem 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 TQCanvasPolygonalItem subclasses only use the brush, ignoring the pen setting.
.PP
The polygonal item can be drawn on a painter with draw(). Subclasses must reimplement drawShape() to draw themselves.
.PP
Like 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().
Like any other canvas item polygonal items can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
This function must be reimplemented by subclasses. It \fImust\fR return the points bounding (i.e. outside and not touching) the shape or drawing errors will occur.
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().
Returns the points the polygonal item \fIwill\fR have after TQCanvasItem::advance(1) is called, i.e. what the points are when advanced by the current xVelocity() and yVelocity().
Returns the QBrush used to fill the item, if filled.
.PP
See 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().
.SH "void TQCanvasPolygonalItem::draw ( QPainter & p )\fC [virtual protected]\fR"
Reimplemented from TQCanvasItem, this draws the polygonal item by setting the pen and brush for the item on the painter \fIp\fR and calling drawShape().
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.
.PP
\fBWarning:\fR When you reimplement this function, make sure that you leave the painter in the same state as you found it. For example, if you start by calling QPainter::translate(50, 50), end your code by calling QPainter::translate(-50, -50). Be also aware that the painter might already have some transformations set (i.e., don't call QPainter::resetXForm() when you're done).
.PP
See also draw().
.PP
Reimplemented in QCanvasRectangle, QCanvasPolygon, and QCanvasEllipse.
Invalidates all information about the area covered by the canvas item. The item will be updated automatically on the next call that changes the item's status, for example, move() or update(). Call this function if you are going to change the shape of the item (as returned by areaPoints()) while the item is visible.
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.
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.
.PP
The default is to use the odd-even algorithm.
@ -168,7 +168,7 @@ The default is to use the odd-even algorithm.
.BI "\fBQCanvasRectangle\fR ( int x, int y, int width, int height, QCanvas * canvas )"
.BI "\fBTQCanvasRectangle\fR ( int x, int y, int width, int height, TQCanvas * canvas )"
.br
.ti -1c
.BI "\fB~QCanvasRectangle\fR ()"
.BI "\fB~TQCanvasRectangle\fR ()"
.br
.ti -1c
.BI "int \fBwidth\fR () const"
@ -56,55 +56,55 @@ Inherits QCanvasPolygonalItem.
.br
.in -1c
.SH DESCRIPTION
The QCanvasRectangle class provides a rectangle on a QCanvas.
The TQCanvasRectangle class provides a rectangle on a TQCanvas.
.PP
This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use QCanvasPolygon.
This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use TQCanvasPolygon.
.PP
The rectangle's size and initial position can be set in the constructor. The size can be set or changed later using setSize(). Use height() and width() to retrieve the rectangle's dimensions.
.PP
The rectangle can be drawn on a painter with drawShape().
.PP
Like any other canvas item rectangles can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item rectangles can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
The QCanvasSpline class provides multi-bezier splines on a QCanvas.
The TQCanvasSpline class provides multi-bezier splines on a TQCanvas.
.PP
A QCanvasSpline is a sequence of 4-point bezier curves joined together to make a curved shape.
A TQCanvasSpline is a sequence of 4-point bezier curves joined together to make a curved shape.
.PP
You set the control points of the spline with setControlPoints().
.PP
@ -45,29 +45,29 @@ If the bezier is closed(), then the first control point will be re-used as the l
.PP
The beziers are not necessarily joined "smoothly". To ensure this, set control points appropriately (general reference texts about beziers will explain this in detail).
.PP
Like any other canvas item splines can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item splines can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
If \fIclose\fR is TRUE, then the first point in \fIctrl\fR will be re-used as the last point, and the number of control points must be a multiple of 3. If \fIclose\fR is FALSE, one additional control point is required, and the number of control points must be one of (4, 7, 10, 13, ...).
@ -77,7 +77,7 @@ If the number of control points doesn't meet the above conditions, the number of
Example: canvas/canvas.cpp.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcanvasspline.html
.BR http://doc.trolltech.com/tqcanvasspline.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
.BI "TQCanvasPixmap * \fBimage\fR ( int f ) const"
.br
.ti -1c
.BI "virtual void \fBadvance\fR ( int phase )"
@ -95,9 +95,9 @@ Inherits QCanvasItem.
.br
.in -1c
.SH DESCRIPTION
The QCanvasSprite class provides an animated canvas item on a QCanvas.
The TQCanvasSprite class provides an animated canvas item on a TQCanvas.
.PP
A canvas sprite is an object which can contain any number of images (referred to as frames), only one of which is current, i.e. displayed, at any one time. The images can be passed in the constructor or set or changed later with setSequence(). If you subclass QCanvasSprite you can change the frame that is displayed periodically, e.g. whenever QCanvasItem::advance(1) is called to create the effect of animation.
A canvas sprite is an object which can contain any number of images (referred to as frames), only one of which is current, i.e. displayed, at any one time. The images can be passed in the constructor or set or changed later with setSequence(). If you subclass TQCanvasSprite you can change the frame that is displayed periodically, e.g. whenever TQCanvasItem::advance(1) is called to create the effect of animation.
.PP
The current frame can be set with setFrame() or with move(). The number of frames available is given by frameCount(). The bounding rectangle of the current frame is returned by boundingRect().
.PP
@ -107,110 +107,110 @@ Use width() and height() to retrieve the dimensions of the current frame.
.PP
Use leftEdge() and rightEdge() to retrieve the current frame's left-hand and right-hand x-coordinates respectively. Use bottomEdge() and topEdge() to retrieve the current frame's bottom and top y-coordinates respectively. These functions have an overload which will accept an integer frame number to retrieve the coordinates of a particular frame.
.PP
QCanvasSprite draws very quickly, at the expense of memory.
TQCanvasSprite draws very quickly, at the expense of memory.
.PP
The current frame's image can be drawn on a painter with draw().
.PP
Like any other canvas item, canvas sprites can be moved with move() which sets the x and y coordinates and the frame number, as well as with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item, canvas sprites can be moved with move() which sets the x and y coordinates and the frame number, as well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
.SS "Member Type Documentation"
.SH "QCanvasSprite::FrameAnimationType"
This enum is used to identify the different types of frame animation offered by QCanvasSprite.
.SH "TQCanvasSprite::FrameAnimationType"
This enum is used to identify the different types of frame animation offered by TQCanvasSprite.
.TP
\fCQCanvasSprite::Cycle\fR - at each advance the frame number will be incremented by 1 (modulo the frame count).
\fCTQCanvasSprite::Cycle\fR - at each advance the frame number will be incremented by 1 (modulo the frame count).
.TP
\fCQCanvasSprite::Oscillate\fR - at each advance the frame number will be incremented by 1 up to the frame count then decremented to by 1 to 0, repeating this sequence forever.
\fCTQCanvasSprite::Oscillate\fR - at each advance the frame number will be incremented by 1 up to the frame count then decremented to by 1 to 0, repeating this sequence forever.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasSprite::QCanvasSprite ( QCanvasPixmapArray * a, QCanvas * canvas )"
Constructs a QCanvasSprite which uses images from the QCanvasPixmapArray \fIa\fR.
.SH "TQCanvasSprite::TQCanvasSprite ( TQCanvasPixmapArray * a, TQCanvas * canvas )"
Constructs a TQCanvasSprite which uses images from the TQCanvasPixmapArray \fIa\fR.
.PP
The sprite in initially positioned at (0, 0) on \fIcanvas\fR, using frame 0.
Destroys the sprite and removes it from the canvas. Does \fInot\fR delete the images.
.SH "void QCanvasSprite::advance ( int phase )\fC [virtual]\fR"
Extends the default QCanvasItem implementation to provide the functionality of setFrameAnimation().
.SH "void TQCanvasSprite::advance ( int phase )\fC [virtual]\fR"
Extends the default TQCanvasItem implementation to provide the functionality of setFrameAnimation().
.PP
The \fIphase\fR is 0 or 1: see QCanvasItem::advance() for details.
The \fIphase\fR is 0 or 1: see TQCanvasItem::advance() for details.
.PP
See also QCanvasItem::advance() and setVelocity().
See also TQCanvasItem::advance() and setVelocity().
.PP
Example: canvas/canvas.cpp.
.PP
Reimplemented from QCanvasItem.
.SH "int QCanvasSprite::bottomEdge () const"
Reimplemented from TQCanvasItem.
.SH "int TQCanvasSprite::bottomEdge () const"
Returns the y-coordinate of the current bottom edge of the sprite. (This may change as the sprite animates since different frames may have different bottom edges.)
.PP
See also leftEdge(), rightEdge(), and topEdge().
.SH "int QCanvasSprite::bottomEdge ( int ny ) const"
.SH "int TQCanvasSprite::bottomEdge ( int ny ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position \fIny\fR.
Returns the bounding rectangle for the image in the sprite's current frame. This assumes that the images are tightly cropped (i.e. do not have transparent pixels all along a side).
Returns the image the sprite \fIwill\fR have after advance(1) is called. By default this is the same as image().
.SH "int QCanvasSprite::leftEdge () const"
.SH "int TQCanvasSprite::leftEdge () const"
Returns the x-coordinate of the current left edge of the sprite. (This may change as the sprite animates since different frames may have different left edges.)
.PP
See also rightEdge(), bottomEdge(), and topEdge().
.SH "int QCanvasSprite::leftEdge ( int nx ) const"
.SH "int TQCanvasSprite::leftEdge ( int nx ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns what the x-coordinate of the left edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position \fInx\fR.
.PP
See also rightEdge(), bottomEdge(), and topEdge().
Set the position of the sprite to \fInx\fR, \fIny\fR and the current frame to \fInf\fR. \fInf\fR will be ignored if it is larger than frameCount() or smaller than 0.
.SH "int QCanvasSprite::rightEdge () const"
.SH "int TQCanvasSprite::rightEdge () const"
Returns the x-coordinate of the current right edge of the sprite. (This may change as the sprite animates since different frames may have different right edges.)
.PP
See also leftEdge(), bottomEdge(), and topEdge().
.SH "int QCanvasSprite::rightEdge ( int nx ) const"
.SH "int TQCanvasSprite::rightEdge ( int nx ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns what the x-coordinate of the right edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position \fInx\fR.
Sets the animation frame used for displaying the sprite to \fIf\fR, an index into the QCanvasSprite's QCanvasPixmapArray. The call will be ignored if \fIf\fR is larger than frameCount() or smaller than 0.
Reimplemented from TQCanvasItem.
.SH "void TQCanvasSprite::setFrame ( int f )"
Sets the animation frame used for displaying the sprite to \fIf\fR, an index into the TQCanvasSprite's TQCanvasPixmapArray. The call will be ignored if \fIf\fR is larger than frameCount() or smaller than 0.
.PP
See also frame() and move().
.SH "void QCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 )\fC [virtual]\fR"
.SH "void TQCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 )\fC [virtual]\fR"
Sets the animation characteristics for the sprite.
.PP
For \fItype\fR == Cycle, the frames will increase by \fIstep\fR at each advance, modulo the frameCount().
@ -218,27 +218,27 @@ For \fItype\fR == Cycle, the frames will increase by \fIstep\fR at each advance,
For \fItype\fR == Oscillate, the frames will increase by \fIstep\fR at each advance, up to the frameCount(), then decrease by \fIstep\fR back to 0, repeating forever.
.PP
The \fIstate\fR parameter is for internal use.
.SH "void QCanvasSprite::setSequence ( QCanvasPixmapArray * a )"
Set the array of images used for displaying the sprite to the QCanvasPixmapArray \fIa\fR.
.SH "void TQCanvasSprite::setSequence ( TQCanvasPixmapArray * a )"
Set the array of images used for displaying the sprite to the TQCanvasPixmapArray \fIa\fR.
.PP
If the current frame() is larger than the number of images in \fIa\fR, the current frame will be reset to 0.
.SH "int QCanvasSprite::topEdge () const"
.SH "int TQCanvasSprite::topEdge () const"
Returns the y-coordinate of the top edge of the sprite. (This may change as the sprite animates since different frames may have different top edges.)
.PP
See also leftEdge(), rightEdge(), and bottomEdge().
.SH "int QCanvasSprite::topEdge ( int ny ) const"
.SH "int TQCanvasSprite::topEdge ( int ny ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position \fIny\fR.
.PP
See also leftEdge(), rightEdge(), and bottomEdge().
.SH "int QCanvasSprite::width () const"
.SH "int TQCanvasSprite::width () const"
The width of the sprite for the current frame's image.
.PP
See also frame().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcanvassprite.html
.BR http://doc.trolltech.com/tqcanvassprite.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
The QCanvasText class provides a text object on a QCanvas.
The TQCanvasText class provides a text object on a TQCanvas.
.PP
A canvas text item has text with font, color and alignment attributes. The text and font can be set in the constructor or set or changed later with setText() and setFont(). The color is set with setColor() and the alignment with setTextFlags(). The text item's bounding rectangle is retrieved with boundingRect().
.PP
The text can be drawn on a painter with draw().
.PP
Like any other canvas item text items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
Like any other canvas item text items can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
The QCanvasView class provides an on-screen view of a QCanvas.
The TQCanvasView class provides an on-screen view of a TQCanvas.
.PP
A QCanvasView is widget which provides a view of a QCanvas.
A TQCanvasView is widget which provides a view of a TQCanvas.
.PP
If you want users to be able to interact with a canvas view, subclass QCanvasView. You might then reimplement QScrollView::contentsMousePressEvent(). For example, assuming no transformation matrix is set:
If you want users to be able to interact with a canvas view, subclass TQCanvasView. You might then reimplement QScrollView::contentsMousePressEvent(). For example, assuming no transformation matrix is set:
.PP
.nf
.br
@ -62,13 +62,13 @@ If you want users to be able to interact with a canvas view, subclass QCanvasVie
.br
{
.br
QCanvasItemList l = canvas()->collisions(e->pos());
TQCanvasItemList l = canvas()->collisions(e->pos());
.br
for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
.br
if ( (*it)->rtti() == QCanvasRectangle::RTTI )
if ( (*it)->rtti() == TQCanvasRectangle::RTTI )
.br
tqDebug("A QCanvasRectangle lies somewhere at this point");
tqDebug("A TQCanvasRectangle lies somewhere at this point");
.br
}
.br
@ -119,43 +119,43 @@ The following code finds the part of the canvas that is visible in this view, i.
See also QWMatrix, QPainter::setWorldMatrix(), Graphics Classes, and Image Processing Classes.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasView::QCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
Constructs a QCanvasView with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. The canvas view is not associated with a canvas, so you must to call setCanvas() to view a canvas.
.SH "TQCanvasView::TQCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
Constructs a TQCanvasView with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. The canvas view is not associated with a canvas, so you must to call setCanvas() to view a canvas.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs a QCanvasView which views canvas \fIcanvas\fR, with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR.
.SH "QCanvasView::~QCanvasView ()"
Constructs a TQCanvasView which views canvas \fIcanvas\fR, with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR.
.SH "TQCanvasView::~TQCanvasView ()"
Destroys the canvas view. The associated canvas is \fInot\fR deleted.
.SH "QCanvas * QCanvasView::canvas () const"
Returns a pointer to the canvas which the QCanvasView is currently showing.
.SH "void QCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch )\fC [virtual protected]\fR"
Repaints part of the QCanvas that the canvas view is showing starting at \fIcx\fR by \fIcy\fR, with a width of \fIcw\fR and a height of \fIch\fR using the painter \fIp\fR.
.SH "TQCanvas * TQCanvasView::canvas () const"
Returns a pointer to the canvas which the TQCanvasView is currently showing.
.SH "void TQCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch )\fC [virtual protected]\fR"
Repaints part of the TQCanvas that the canvas view is showing starting at \fIcx\fR by \fIcy\fR, with a width of \fIcw\fR and a height of \fIch\fR using the painter \fIp\fR.
.PP
\fBWarning:\fR When double buffering is enabled, drawContents() will not respect the current settings of the painter when setting up the painter for the double buffer (e.g., viewport() and window()). Also, be aware that QCanvas::update() bypasses drawContents(), which means any reimplementation of drawContents() is not called.
\fBWarning:\fR When double buffering is enabled, drawContents() will not respect the current settings of the painter when setting up the painter for the double buffer (e.g., viewport() and window()). Also, be aware that TQCanvas::update() bypasses drawContents(), which means any reimplementation of drawContents() is not called.
Sets the transformation matrix of the QCanvasView to \fIwm\fR. The matrix must be invertible (i.e. if you create a world matrix that zooms out by 2 times, then the inverse of this matrix is one that will zoom in by 2 times).
Sets the transformation matrix of the TQCanvasView to \fIwm\fR. The matrix must be invertible (i.e. if you create a world matrix that zooms out by 2 times, then the inverse of this matrix is one that will zoom in by 2 times).
.PP
When you use this, you should note that the performance of the QCanvasView will decrease considerably.
When you use this, you should note that the performance of the TQCanvasView will decrease considerably.
.PP
Returns FALSE if \fIwm\fR is not invertable; otherwise returns TRUE.
.PP
See also worldMatrix(), inverseWorldMatrix(), and QWMatrix::isInvertible().
@ -110,7 +110,7 @@ If you need to monitor changes to the grid's dimensions (i.e. when numRows or nu
.PP
Note: the row and column indices are always given in the order, row (vertical offset) then column (horizontal offset). This order is the opposite of all pixel operations, which are given in the order x (horizontal offset), y (vertical offset).
.PP
QGridView is a very simple abstract class based on QScrollView. It is designed to simplify the task of drawing many cells of the same size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a QTable instead. If you need a simple list of items, use a QListBox. If you need to present hierachical data use a QListView, and if you need random objects at random positions, consider using either a QIconView or a QCanvas.
QGridView is a very simple abstract class based on QScrollView. It is designed to simplify the task of drawing many cells of the same size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a QTable instead. If you need a simple list of items, use a QListBox. If you need to present hierachical data use a QListView, and if you need random objects at random positions, consider using either a QIconView or a TQCanvas.
@ -13,7 +13,7 @@ QScrollView \- Scrolling area with on-demand scroll bars
.PP
Inherits QFrame.
.PP
Inherited by QCanvasView, QTable, QGridView, QIconView, QListBox, QListView, and QTextEdit.
Inherited by TQCanvasView, QTable, QGridView, QIconView, QListBox, QListView, and QTextEdit.
.PP
.SS "Public Members"
.in +1c
@ -635,7 +635,7 @@ The clip rectangle and translation of the painter \fIp\fR is already set appropr
.PP
Example: qdir/qdir.cpp.
.PP
Reimplemented in QCanvasView and QTable.
Reimplemented in TQCanvasView and QTable.
.SH "void QScrollView::drawContentsOffset ( QPainter * p, int offsetx, int offsety, int clipx, int clipy, int clipw, int cliph )\fC [virtual protected]\fR"
For backward-compatibility only. It is easier to use drawContents(QPainter*,int,int,int,int).
@ -1802,7 +1802,7 @@ This event handler can be reimplemented in a subclass to receive paint events.
.PP
A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.
.PP
Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example.
Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and TQCanvas do this, for example.
.PP
Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, TQt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible.