The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a diagram, that can be saved to .qet file.
More...
#include <qetshapeitem.h>
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a diagram, that can be saved to .qet file.
◆ anonymous enum
◆ ShapeType
Enumerator |
---|
Line | |
Rectangle | |
Ellipse | |
Polygon | |
◆ QetShapeItem()
QetShapeItem::QetShapeItem |
( |
QPointF |
p1, |
|
|
QPointF |
p2 = QPointF(0,0) , |
|
|
ShapeType |
type = Line , |
|
|
QGraphicsItem * |
parent = nullptr |
|
) |
| |
QetShapeItem::QetShapeItem Constructor of shape item. point 1 and 2 must be in scene coordinate.
- Parameters
-
p1 | first point |
p2 | second point |
type | type of item (line, rectangle, ellipse) |
parent | parent item |
◆ ~QetShapeItem()
QetShapeItem::~QetShapeItem |
( |
| ) |
|
|
override |
◆ addHandler()
void QetShapeItem::addHandler |
( |
| ) |
|
|
private |
◆ adjusteHandlerPos()
void QetShapeItem::adjusteHandlerPos |
( |
| ) |
|
|
private |
◆ boundingRect()
QRectF QetShapeItem::boundingRect |
( |
| ) |
const |
|
override |
◆ brush()
QBrush QetShapeItem::brush |
( |
| ) |
const |
|
inline |
◆ brushChanged
void QetShapeItem::brushChanged |
( |
| ) |
|
|
signal |
◆ closeChanged
void QetShapeItem::closeChanged |
( |
| ) |
|
|
signal |
◆ contextMenuEvent()
void QetShapeItem::contextMenuEvent |
( |
QGraphicsSceneContextMenuEvent * |
event | ) |
|
|
overrideprotected |
◆ editProperty()
void QetShapeItem::editProperty |
( |
| ) |
|
|
overridevirtual |
◆ fromXml()
bool QetShapeItem::fromXml |
( |
const QDomElement & |
e | ) |
|
|
virtual |
QetShapeItem::fromXml Build this item from the xml description.
- Parameters
-
e | element where is stored this item |
- Returns
- true if load success
◆ handlerMouseMoveEvent()
void QetShapeItem::handlerMouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
private |
◆ handlerMousePressEvent()
void QetShapeItem::handlerMousePressEvent |
( |
| ) |
|
|
private |
◆ handlerMouseReleaseEvent()
void QetShapeItem::handlerMouseReleaseEvent |
( |
| ) |
|
|
private |
◆ hoverEnterEvent()
void QetShapeItem::hoverEnterEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotected |
◆ hoverLeaveEvent()
void QetShapeItem::hoverLeaveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotected |
◆ insertPoint()
void QetShapeItem::insertPoint |
( |
| ) |
|
|
private |
◆ isClosed()
bool QetShapeItem::isClosed |
( |
| ) |
const |
|
inline |
◆ itemChange()
QVariant QetShapeItem::itemChange |
( |
GraphicsItemChange |
change, |
|
|
const QVariant & |
value |
|
) |
| |
|
overrideprotected |
◆ line()
QLineF QetShapeItem::line |
( |
| ) |
const |
|
inline |
◆ mousePressEvent()
void QetShapeItem::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ name()
QString QetShapeItem::name |
( |
| ) |
const |
|
overridevirtual |
◆ paint()
void QetShapeItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget |
|
) |
| |
|
overrideprotected |
◆ pen()
QPen QetShapeItem::pen |
( |
| ) |
const |
|
inline |
◆ penChanged
void QetShapeItem::penChanged |
( |
| ) |
|
|
signal |
◆ pointsCount()
int QetShapeItem::pointsCount |
( |
| ) |
const |
QetShapeItem::pointCount.
- Returns
- the number of point in the polygon
◆ polygon()
QPolygonF QetShapeItem::polygon |
( |
| ) |
const |
|
inline |
◆ rect()
QRectF QetShapeItem::rect |
( |
| ) |
const |
|
inline |
◆ removePoint()
void QetShapeItem::removePoint |
( |
| ) |
|
|
private |
◆ removePoints()
void QetShapeItem::removePoints |
( |
int |
number = 1 | ) |
|
QetShapeItem::removePoints Number of point to remove on the polygon If number is superior to number of polygon points-2, all points of polygon will be removed except the first two (minimum point for the polygon);.
◆ sceneEventFilter()
bool QetShapeItem::sceneEventFilter |
( |
QGraphicsItem * |
watched, |
|
|
QEvent * |
event |
|
) |
| |
|
overrideprotected |
◆ setBrush()
void QetShapeItem::setBrush |
( |
const QBrush & |
brush | ) |
|
◆ setClosed()
void QetShapeItem::setClosed |
( |
bool |
close | ) |
|
◆ setLine()
bool QetShapeItem::setLine |
( |
const QLineF & |
line | ) |
|
QetShapeItem::setLine Set item geometry to line (only available for line shape)
- Parameters
-
- Returns
- : true when shape is a Line, else false
◆ setNextPoint()
void QetShapeItem::setNextPoint |
( |
QPointF |
P | ) |
|
◆ setP2()
void QetShapeItem::setP2 |
( |
const QPointF & |
P2 | ) |
|
QetShapeItem::setP2 Set the second point of this item. If this item is a polyline, the last point of the polyline is replaced by P2.
- Parameters
-
◆ setPen()
void QetShapeItem::setPen |
( |
const QPen & |
pen | ) |
|
◆ setPolygon()
bool QetShapeItem::setPolygon |
( |
const QPolygonF & |
polygon | ) |
|
QetShapeItem::setPolygon Set this item geometry to polygon (only available if shape is a polyline)
- Parameters
-
- Returns
- true if item is polygon, else false
◆ setRect()
bool QetShapeItem::setRect |
( |
const QRectF & |
rect | ) |
|
QetShapeItem::setRect Set this item geometry to rect (only available if shape is a rectangle or an ellipse)
- Parameters
-
- Returns
- : true when shape is rectangle or ellipse, else false
◆ setXRadius()
void QetShapeItem::setXRadius |
( |
qreal |
X | ) |
|
◆ setYRadius()
void QetShapeItem::setYRadius |
( |
qreal |
Y | ) |
|
◆ shape()
QPainterPath QetShapeItem::shape |
( |
| ) |
const |
|
override |
◆ shapeType()
◆ switchResizeMode()
void QetShapeItem::switchResizeMode |
( |
| ) |
|
|
private |
◆ toDXF()
bool QetShapeItem::toDXF |
( |
const QString & |
filepath, |
|
|
const QPen & |
pen |
|
) |
| |
|
virtual |
QetShapeItem::toDXF Draw this element to the dxf document.
- Parameters
-
filepath | file path of the the dxf document |
pen | |
- Returns
- true if draw success
◆ toXml()
QDomElement QetShapeItem::toXml |
( |
QDomDocument & |
document | ) |
const |
|
virtual |
QetShapeItem::toXml Save this item to xml element.
- Parameters
-
document | parent document xml |
- Returns
- element xml where is write this item
◆ type()
int QetShapeItem::type |
( |
| ) |
const |
|
inlineoverride |
◆ XRadius()
qreal QetShapeItem::XRadius |
( |
| ) |
const |
|
inline |
◆ XRadiusChanged
void QetShapeItem::XRadiusChanged |
( |
| ) |
|
|
signal |
◆ YRadius()
qreal QetShapeItem::YRadius |
( |
| ) |
const |
|
inline |
◆ YRadiusChanged
void QetShapeItem::YRadiusChanged |
( |
| ) |
|
|
signal |
◆ m_brush
QBrush QetShapeItem::m_brush |
|
private |
◆ m_closed
bool QetShapeItem::m_closed = false |
|
private |
◆ m_context_menu_pos
QPointF QetShapeItem::m_context_menu_pos |
|
private |
◆ m_handler_vector
◆ m_hovered
bool QetShapeItem::m_hovered |
|
private |
◆ m_insert_point
QAction* QetShapeItem::m_insert_point |
|
private |
◆ m_modifie_radius_equaly
bool QetShapeItem::m_modifie_radius_equaly = false |
|
private |
◆ m_old_P1
QPointF QetShapeItem::m_old_P1 |
|
private |
◆ m_old_P2
QPointF QetShapeItem::m_old_P2 |
|
private |
◆ m_old_polygon
QPolygonF QetShapeItem::m_old_polygon |
|
private |
◆ m_old_xRadius
qreal QetShapeItem::m_old_xRadius |
|
private |
◆ m_old_yRadius
qreal QetShapeItem::m_old_yRadius |
|
private |
◆ m_P1
QPointF QetShapeItem::m_P1 |
|
private |
◆ m_P2
QPointF QetShapeItem::m_P2 |
|
private |
◆ m_pen
◆ m_polygon
QPolygonF QetShapeItem::m_polygon |
|
private |
◆ m_remove_point
QAction * QetShapeItem::m_remove_point |
|
private |
◆ m_resize_mode
int QetShapeItem::m_resize_mode = 1 |
|
private |
◆ m_shapeType
◆ m_vector_index
int QetShapeItem::m_vector_index |
|
private |
◆ m_xRadius
qreal QetShapeItem::m_xRadius = 0 |
|
private |
◆ m_yRadius
qreal QetShapeItem::m_yRadius = 0 |
|
private |
◆ brush
QBrush QetShapeItem::brush |
|
readwrite |
◆ close
◆ line
QLineF QetShapeItem::line |
|
readwrite |
◆ pen
◆ polygon
QPolygonF QetShapeItem::polygon |
|
readwrite |
◆ rect
QRectF QetShapeItem::rect |
|
readwrite |
◆ xRadius
qreal QetShapeItem::xRadius |
|
readwrite |
◆ yRadius
qreal QetShapeItem::yRadius |
|
readwrite |
The documentation for this class was generated from the following files: