Seamly2D
Code documentation
SceneRect Class Reference

#include <scene_rect.h>

Inheritance diagram for SceneRect:
Collaboration diagram for SceneRect:

Public Types

enum  { Type = UserType + static_cast<int>(Vis::ScenePoint) }
 

Public Member Functions

 SceneRect (const QColor &lineColor, QGraphicsItem *parent=nullptr)
 
virtual ~SceneRect ()=default
 
virtual int type () const Q_DECL_OVERRIDE
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
 
virtual void refreshPointGeometry (const VPointF &point)
 

Protected Member Functions

virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
void setOnlyPoint (bool value)
 
bool isOnlyPoint () const
 
void setPointColor (const QString &value)
 

Protected Attributes

QColor m_rectColor
 
bool m_onlyPoint
 m_rectColor color of point. More...
 
bool m_isHovered
 
bool m_showPointName
 

Private Member Functions

void setRectPen (qreal scale)
 

Detailed Description

Definition at line 38 of file scene_rect.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 44 of file scene_rect.h.

Constructor & Destructor Documentation

◆ SceneRect()

SceneRect::SceneRect ( const QColor &  lineColor,
QGraphicsItem *  parent = nullptr 
)
explicit

Definition at line 41 of file scene_rect.cpp.

◆ ~SceneRect()

virtual SceneRect::~SceneRect ( )
virtualdefault

Member Function Documentation

◆ hoverEnterEvent()

void SceneRect::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented in VControlPointSpline.

Definition at line 90 of file scene_rect.cpp.

References m_isHovered.

Referenced by VControlPointSpline::hoverEnterEvent().

◆ hoverLeaveEvent()

void SceneRect::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented in VControlPointSpline.

Definition at line 97 of file scene_rect.cpp.

References m_isHovered.

Referenced by VControlPointSpline::hoverLeaveEvent().

◆ isOnlyPoint()

bool SceneRect::isOnlyPoint ( ) const
protected

Definition at line 79 of file scene_rect.cpp.

References m_onlyPoint.

◆ paint()

void SceneRect::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
virtual

Reimplemented in VControlPointSpline.

Definition at line 54 of file scene_rect.cpp.

References scaleRectSize(), sceneScale(), and setRectPen().

Referenced by VControlPointSpline::paint().

◆ refreshPointGeometry()

void SceneRect::refreshPointGeometry ( const VPointF point)
virtual

Definition at line 65 of file scene_rect.cpp.

◆ setOnlyPoint()

void SceneRect::setOnlyPoint ( bool  value)
protected

Definition at line 73 of file scene_rect.cpp.

References m_onlyPoint.

Referenced by VControlPointSpline::init().

◆ setPointColor()

void SceneRect::setPointColor ( const QString &  value)
protected

Definition at line 84 of file scene_rect.cpp.

References m_rectColor.

◆ setRectPen()

void SceneRect::setRectPen ( qreal  scale)
private

Definition at line 104 of file scene_rect.cpp.

References m_isHovered, m_rectColor, qApp, scaleWidth(), widthHairLine, and widthMainLine.

Referenced by paint().

◆ type()

virtual int SceneRect::type ( ) const
inlinevirtual

Reimplemented in VControlPointSpline.

Definition at line 43 of file scene_rect.h.

References Type.

Member Data Documentation

◆ m_isHovered

bool SceneRect::m_isHovered
protected

Definition at line 53 of file scene_rect.h.

Referenced by hoverEnterEvent(), hoverLeaveEvent(), and setRectPen().

◆ m_onlyPoint

bool SceneRect::m_onlyPoint
protected

m_rectColor color of point.

Definition at line 52 of file scene_rect.h.

Referenced by isOnlyPoint(), and setOnlyPoint().

◆ m_rectColor

QColor SceneRect::m_rectColor
protected

Definition at line 51 of file scene_rect.h.

Referenced by setPointColor(), and setRectPen().

◆ m_showPointName

bool SceneRect::m_showPointName
protected

Definition at line 54 of file scene_rect.h.


The documentation for this class was generated from the following files: