25 #ifndef WQTNETWORKITEMACTIVATOR_H
26 #define WQTNETWORKITEMACTIVATOR_H
30 #include <QGraphicsLineItem>
31 #include <QGraphicsPolygonItem>
32 #include <boost/signals2.hpp>
34 #include "WQtNetworkArrow.h"
35 #include "WQtNetworkItemActivator.h"
68 virtual int type()
const;
77 virtual void paint( QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget );
Small graphics item that respresents whether a module in the network editor is active or not.
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
Start drawing an arrow temporary.
WQtNetworkItemActivator(std::shared_ptr< WModule > module)
Constructor for indicator showing if module is active.
std::shared_ptr< WModule > m_module
the module
bool m_needStateUpdate
If true, the module state changed.
~WQtNetworkItemActivator()
Destructor.
void activeChangeNotifier()
Callback getting called by the module's active property to know about state changes.
boost::signals2::connection m_notifierConnection
The connection used for notification.
void handleActiveState()
Setups tooltip and brush acccording to state.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Actually paints the port.
QColor m_inactiveColor
color used for inactive indicator
virtual int type() const
Reimplementation from QGraphicsItem.
QColor m_activeColor
color used for active indicator