Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
GenericIndicator< T, G > Class Template Reference

A generic indicator bundling common interaction behaviours. More...

#include <GenericIndicator.hpp>

Inheritance diagram for GenericIndicator< T, G >:
Inheritance graph
[legend]
Collaboration diagram for GenericIndicator< T, G >:
Collaboration graph
[legend]

Public Member Functions

 GenericIndicator (T *element, QGraphicsItem *parent=nullptr)
 
void setOnDoubleClick (const std::function< void(T *)> &fn)
 Registers a double click handler. More...
 
void setOnSelected (const std::function< void(T *)> &fn)
 Registers a select handler. More...
 

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 
virtual bool respondToEvent (QPointF)
 Checks whether the indicator should react to an event at a given point. More...
 

Detailed Description

template<class T, class G>
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
class GenericIndicator< T, G >

A generic indicator bundling common interaction behaviours.

This abstracts handling common interactions such as

Template Parameters
T
G

Definition at line 32 of file GenericIndicator.hpp.

Constructor & Destructor Documentation

◆ GenericIndicator()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
GenericIndicator< T, G >::GenericIndicator ( T *  element,
QGraphicsItem *  parent = nullptr 
)
explicit

Definition at line 29 of file GenericIndicator.cpp.

Member Function Documentation

◆ hoverEnterEvent()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Definition at line 66 of file GenericIndicator.cpp.

◆ hoverLeaveEvent()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Definition at line 77 of file GenericIndicator.cpp.

◆ mouseDoubleClickEvent()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Definition at line 46 of file GenericIndicator.cpp.

◆ mousePressEvent()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Definition at line 56 of file GenericIndicator.cpp.

◆ respondToEvent()

template<class T , class G >
virtual bool GenericIndicator< T, G >::respondToEvent ( QPointF  )
inlineprotectedvirtual

Checks whether the indicator should react to an event at a given point.

This function should be overwritten in derived classes. By default this function always returns true.

Parameters
pointThe point at which the event occured
Returns
True if the indicator should react to the event, false otherwise

Reimplemented in CollectiveCommunicationIndicator.

Definition at line 82 of file GenericIndicator.hpp.

◆ setOnDoubleClick()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::setOnDoubleClick ( const std::function< void(T *)> &  fn)

Registers a double click handler.

Registers a callback function that is invoked whenever the user double clicked on the indicator.

Parameters
fnCallback to be invoked on double click

Definition at line 36 of file GenericIndicator.cpp.

◆ setOnSelected()

template<class T , class G >
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
void GenericIndicator< T, G >::setOnSelected ( const std::function< void(T *)> &  fn)

Registers a select handler.

Registers a callback function that is invoked whenever the user selects the indicator by left cliking on it.

Parameters
fnCallback to be invoked on selection

Definition at line 41 of file GenericIndicator.cpp.


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