Workspace 6.21.5
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
ConnectionPort Class Referenceabstract

Widget class for representing an input/output port attached to an operation view. More...

#include <Workspace/Presentation/ConnectionRacks/connectionport.h>

Inheritance diagram for ConnectionPort:
[legend]

Public Types

enum  { Type = WorkspaceScene::ConnectionPortT }
 
enum class  LabelLocation { Right , Left }
 

Signals

void dragFromInputStarted (const DataExecution::IOBase &ioBase)
 
void dragFromOutputStarted (const DataExecution::IOBase &ioBase)
 
void itemPositionChanged ()
 
void itemVisibilityChanged (bool visible)
 
void notifyDragStarter ()
 
void requestZValue (qreal z)
 
void setStatusMessage (const QString &message)
 
void setWorkspaceTooltip (const QString &tooltip)
 

Public Member Functions

 ConnectionPort (DataExecution::IOBase &ioBase, DataExecution::Operation &op, const WorkspaceGraphicsEffectFactory &factory, QGraphicsItem *parent=nullptr)
 
 ~ConnectionPort () override
 
virtual DataExecution::IOBasegetIOBase ()=0
 
QGraphicsSimpleTextItem * getLabel ()
 
virtual QString getToolTip () const =0
 
virtual bool isArrayElement () const =0
 
bool isHighlighted () const
 
bool isValidConnectionTarget () const
 
void resetLabelLocation ()
 
void setDefaultLabelLocation (LabelLocation location)
 
virtual void setHighlighted (bool highlight, bool applyToAllSourceConnections)
 
void setLabelHorizontalOffset (qreal labelOffsetX)
 
void setLabelLocation (LabelLocation location)
 
void setValidConnectionTarget (bool valid)
 
int type () const override
 

Protected Member Functions

virtual QString getStatusBarMessage ()=0
 
WorkspaceScenegetWorkspaceScene ()
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
void installGraphicsEffect ()
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void setLabel (const QString &text)
 
void setLabelFont (const QFont &font)
 
virtual bool supportsData () const =0
 

Detailed Description

An input/output port will automatically delete itself when the input/output it is representing is deleted. This implies that unless clients can ensure that they will manually delete the port before the input/output, the port should be created dynamically with operator new. This is the strategy employed by the Workspace code and client code outside of the Workspace module should never attempt to create a connection port directly.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

◆ LabelLocation

enum class LabelLocation
strong
Enumerator
Right 
Left 

Constructor & Destructor Documentation

◆ ConnectionPort()

ConnectionPort ( DataExecution::IOBase ioBase,
DataExecution::Operation op,
const WorkspaceGraphicsEffectFactory factory,
QGraphicsItem *  parent = nullptr 
)

◆ ~ConnectionPort()

~ConnectionPort ( )
overridedefault

Member Function Documentation

◆ dragFromInputStarted

void dragFromInputStarted ( const DataExecution::IOBase ioBase)
signal

◆ dragFromOutputStarted

void dragFromOutputStarted ( const DataExecution::IOBase ioBase)
signal

◆ getIOBase()

virtual DataExecution::IOBase & getIOBase ( )
pure virtual
Returns
Return the IOBase associated with the connection port.

Implemented in InputArrayPort, InputScalarPort, and OutputPort.

◆ getLabel()

QGraphicsSimpleTextItem * getLabel ( )

◆ getStatusBarMessage()

virtual QString getStatusBarMessage ( )
protectedpure virtual

Implemented in InputArrayPort, InputScalarPort, and OutputPort.

◆ getToolTip()

virtual QString getToolTip ( ) const
pure virtual
Returns
The tool tip text for this port.

Implemented in InputArrayPort, InputScalarPort, and OutputPort.

◆ getWorkspaceScene()

WorkspaceScene & getWorkspaceScene ( )
protected

◆ hoverEnterEvent()

void hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

◆ hoverLeaveEvent()

void hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

◆ installGraphicsEffect()

void installGraphicsEffect ( )
protected

◆ isArrayElement()

virtual bool isArrayElement ( ) const
pure virtual
Returns
True if the connection port is associated with an array element, false otherwise.

Implemented in InputArrayPort, InputScalarPort, and OutputPort.

◆ isHighlighted()

bool isHighlighted ( ) const
Returns
True if the port is currently highlighted. This is normally the result of the mouse being currently over the port and is intended for subclasses to use when painting the widget.

◆ isValidConnectionTarget()

bool isValidConnectionTarget ( ) const

◆ itemChange()

QVariant itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

◆ itemPositionChanged

void itemPositionChanged ( )
signal

◆ itemVisibilityChanged

void itemVisibilityChanged ( bool  visible)
signal

◆ notifyDragStarter

void notifyDragStarter ( )
signal

◆ requestZValue

void requestZValue ( qreal  z)
signal

◆ resetLabelLocation()

void resetLabelLocation ( )

◆ setDefaultLabelLocation()

void setDefaultLabelLocation ( LabelLocation  location)

◆ setHighlighted()

void setHighlighted ( bool  highlight,
bool  applyToAllSourceConnections 
)
virtual

Reimplemented in InputScalarPort, and OutputPort.

◆ setLabel()

void setLabel ( const QString &  text)
protected

◆ setLabelFont()

void setLabelFont ( const QFont &  font)
protected

◆ setLabelHorizontalOffset()

void setLabelHorizontalOffset ( qreal  labelOffsetX)

Mini operations will set a custom horizontal offset for port labels.

◆ setLabelLocation()

void setLabelLocation ( LabelLocation  location)

◆ setStatusMessage

void setStatusMessage ( const QString &  message)
signal

◆ setValidConnectionTarget()

void setValidConnectionTarget ( bool  valid)

◆ setWorkspaceTooltip

void setWorkspaceTooltip ( const QString &  tooltip)
signal

◆ supportsData()

virtual bool supportsData ( ) const
protectedpure virtual

Implemented in InputArrayPort, InputScalarPort, and OutputPort.

◆ type()

int type ( ) const
inlineoverride