Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

Q3CanvasEllipse Class

TheQ3CanvasEllipse class provides an ellipse or ellipse segment on aQ3Canvas.More...

Header:#include <Q3CanvasEllipse>
Inherits:Q3CanvasPolygonalItem

Public Functions

Q3CanvasEllipse(Q3Canvas * canvas)
Q3CanvasEllipse(int width, int height, Q3Canvas * canvas)
Q3CanvasEllipse(int width, int height, int startangle, int angle, Q3Canvas * canvas)
~Q3CanvasEllipse()
intangleLength() const
intangleStart() const
intheight() const
voidsetAngles(int start, int length)
voidsetSize(int width, int height)
intwidth() const

Reimplemented Public Functions

virtual Q3PointArrayareaPoints() const
virtual boolcollidesWith(const Q3CanvasItem * i) const
virtual intrtti() const

Reimplemented Protected Functions

virtual voiddrawShape(QPainter & p)

Detailed Description

TheQ3CanvasEllipse class provides an ellipse or ellipse segment on aQ3Canvas.

A canvas item that paints an ellipse or ellipse segment with aQBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime withsetSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) withsetAngles().

Note that angles are specified in 16ths of a degree.

Ellipse

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 length angle is the angle from the start angle in a counter-clockwise direction (shown in blue in the diagram). The blue 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.

The ellipse can be drawn on a painter withdrawShape().

Like any other canvas item ellipses can be moved withmove() andmoveBy(), or by setting coordinates withsetX(),setY() andsetZ().

Note:Q3CanvasEllipse does not use the pen.

See alsoQtCanvas andPorting to Graphics View.

Member Function Documentation

Q3CanvasEllipse::Q3CanvasEllipse(Q3Canvas * canvas)

Constructs a 32x32 ellipse, centered at (0, 0) oncanvas.

Q3CanvasEllipse::Q3CanvasEllipse(int width,int height,Q3Canvas * canvas)

Constructs awidth byheight pixel ellipse, centered at (0, 0) oncanvas.

Q3CanvasEllipse::Q3CanvasEllipse(int width,int height,int startangle,int angle,Q3Canvas * canvas)

Constructs awidth byheight pixel ellipse, centered at (0, 0) oncanvas. Only a segment of the ellipse is drawn, starting at anglestartangle, and extending for angleangle (the angle length).

Note that angles are specified in sixteenths of a degree.

Q3CanvasEllipse::~Q3CanvasEllipse()

Destroys the ellipse.

int Q3CanvasEllipse::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).

See alsosetAngles() andangleStart().

int Q3CanvasEllipse::angleStart() const

Returns the start angle in 16ths of a degree. Initially this will be 0.

See alsosetAngles() andangleLength().

[virtual]Q3PointArray Q3CanvasEllipse::areaPoints() const

Reimplemented fromQ3CanvasPolygonalItem::areaPoints().

[virtual]bool Q3CanvasEllipse::collidesWith(constQ3CanvasItem * i) const

Reimplemented fromQ3CanvasItem::collidesWith().

[virtual protected]void Q3CanvasEllipse::drawShape(QPainter & p)

Reimplemented fromQ3CanvasPolygonalItem::drawShape().

Draws the ellipse, centered atx(),y() using the painterp.

Note thatQ3CanvasEllipse does not support an outline (the pen is always NoPen).

int Q3CanvasEllipse::height() const

Returns the height of the ellipse.

[virtual]int Q3CanvasEllipse::rtti() const

Reimplemented fromQ3CanvasItem::rtti().

Returns 6 (Q3CanvasItem::Rtti_Ellipse).

See alsoQ3CanvasItem::rtti().

void Q3CanvasEllipse::setAngles(int start,int length)

Sets the angles for the ellipse. The start angle isstart and the extent of the segment islength (the angle length) from thestart. 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).

See alsoangleStart() andangleLength().

void Q3CanvasEllipse::setSize(int width,int height)

Sets thewidth andheight of the ellipse.

int Q3CanvasEllipse::width() const

Returns the width of the ellipse.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp