OpenWalnut
1.5.0dev
|
Small graphics item that respresents whether a module in the network editor is active or not. More...
#include <WQtNetworkItemActivator.h>
Public Types | |
enum | { Type = UserType + 13 } |
This customize the return value of type() More... | |
Public Member Functions | |
WQtNetworkItemActivator (std::shared_ptr< WModule > module) | |
Constructor for indicator showing if module is active. More... | |
~WQtNetworkItemActivator () | |
Destructor. More... | |
virtual int | type () const |
Reimplementation from QGraphicsItem. More... | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
Actually paints the port. More... | |
Protected Member Functions | |
void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) |
Start drawing an arrow temporary. More... | |
void | activeChangeNotifier () |
Callback getting called by the module's active property to know about state changes. More... | |
void | handleActiveState () |
Setups tooltip and brush acccording to state. More... | |
Protected Attributes | |
std::shared_ptr< WModule > | m_module |
the module More... | |
QColor | m_activeColor |
color used for active indicator More... | |
QColor | m_inactiveColor |
color used for inactive indicator More... | |
boost::signals2::connection | m_notifierConnection |
The connection used for notification. More... | |
bool | m_needStateUpdate |
If true, the module state changed. More... | |
Small graphics item that respresents whether a module in the network editor is active or not.
Clicking on it can toggle the state.
Definition at line 41 of file WQtNetworkItemActivator.h.
anonymous enum |
This customize the return value of type()
Definition at line 59 of file WQtNetworkItemActivator.h.
|
explicit |
Constructor for indicator showing if module is active.
module | The module whose state is represented by this indicator. |
Definition at line 39 of file WQtNetworkItemActivator.cpp.
References activeChangeNotifier(), m_module, m_needStateUpdate, and m_notifierConnection.
WQtNetworkItemActivator::~WQtNetworkItemActivator | ( | ) |
Destructor.
Definition at line 68 of file WQtNetworkItemActivator.cpp.
|
protected |
Callback getting called by the module's active property to know about state changes.
Definition at line 77 of file WQtNetworkItemActivator.cpp.
References m_needStateUpdate.
Referenced by WQtNetworkItemActivator().
|
protected |
Setups tooltip and brush acccording to state.
Definition at line 120 of file WQtNetworkItemActivator.cpp.
References m_activeColor, m_inactiveColor, and m_module.
Referenced by mousePressEvent(), and paint().
|
protected |
Start drawing an arrow temporary.
mouseEvent | the mouse event |
Definition at line 95 of file WQtNetworkItemActivator.cpp.
References handleActiveState(), and m_module.
|
virtual |
Actually paints the port.
painter | the painter |
option | style options |
widget | parent widget. |
Definition at line 85 of file WQtNetworkItemActivator.cpp.
References handleActiveState(), and m_needStateUpdate.
|
virtual |
Reimplementation from QGraphicsItem.
Definition at line 72 of file WQtNetworkItemActivator.cpp.
|
protected |
color used for active indicator
Definition at line 88 of file WQtNetworkItemActivator.h.
Referenced by handleActiveState().
|
protected |
color used for inactive indicator
Definition at line 89 of file WQtNetworkItemActivator.h.
Referenced by handleActiveState().
|
protected |
the module
Definition at line 86 of file WQtNetworkItemActivator.h.
Referenced by handleActiveState(), mousePressEvent(), and WQtNetworkItemActivator().
|
protected |
If true, the module state changed.
Update the item.
Definition at line 104 of file WQtNetworkItemActivator.h.
Referenced by activeChangeNotifier(), paint(), and WQtNetworkItemActivator().
|
protected |
The connection used for notification.
Definition at line 94 of file WQtNetworkItemActivator.h.
Referenced by WQtNetworkItemActivator().