Engauge Digitizer 2
Loading...
Searching...
No Matches
GraphicsLineItemRelay Class Reference

Enable postponed geometry changes for QGraphicsLineItem, using a signal to trigger this class to update its associated QGraphicsLineItem instance. More...

#include <GraphicsLineItemRelay.h>

Inheritance diagram for GraphicsLineItemRelay:
Inheritance graph
Collaboration diagram for GraphicsLineItemRelay:
Collaboration graph

Public Slots

void slotUpdateEndpoints (QPointF start, QPointF end)
 Slot equivalent of setStartAngle and setSpanAngle.

Public Member Functions

 GraphicsLineItemRelay (QObject *caller, QGraphicsLineItem *graphicsItem)
 Single constructor with associated GraphicsArcItem.
virtual ~GraphicsLineItemRelay ()

Detailed Description

Enable postponed geometry changes for QGraphicsLineItem, using a signal to trigger this class to update its associated QGraphicsLineItem instance.

By postponing geometry updates locally, this class simplifies the calling code which can invoked while an event handler is on the stack. Updating QGraphicsEllipseItem geometry while an event handler is on the stack is not good software design

Definition at line 21 of file GraphicsLineItemRelay.h.

Constructor & Destructor Documentation

◆ GraphicsLineItemRelay()

GraphicsLineItemRelay::GraphicsLineItemRelay ( QObject * caller,
QGraphicsLineItem * graphicsItem )

Single constructor with associated GraphicsArcItem.

Definition at line 16 of file GraphicsLineItemRelay.cpp.

17 :
18 m_graphicsItem (graphicsItem)
19{
20 // Queue for later by including Qt::QueuedConnection
21 connect (caller, SIGNAL (signalUpdateEndpoints (QPointF, QPointF)),
22 this, SLOT (slotUpdateEndpoints (QPointF, QPointF)),
23 Qt::QueuedConnection);
24}
void slotUpdateEndpoints(QPointF start, QPointF end)
Slot equivalent of setStartAngle and setSpanAngle.

◆ ~GraphicsLineItemRelay()

GraphicsLineItemRelay::~GraphicsLineItemRelay ( )
virtual

Definition at line 26 of file GraphicsLineItemRelay.cpp.

27{
28 // Calling code is responsible for deallocating graphics item
29}

Member Function Documentation

◆ slotUpdateEndpoints

void GraphicsLineItemRelay::slotUpdateEndpoints ( QPointF start,
QPointF end )
slot

Slot equivalent of setStartAngle and setSpanAngle.

Definition at line 31 of file GraphicsLineItemRelay.cpp.

33{
34 m_graphicsItem->setLine (QLineF (start,
35 end));
36}

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