Class for graphical representation of node connector pins.
More...
#include <PinGraphicsItem.h>
|
void | parameterClicked (PinGraphicsItem *pinItem, Parameter *parameter) |
| Signal that is emitted when a parameter represented by the pin has been clicked. Is either emitted when a pin representing one parameter only itself has been clicked, or when an entry in the context menu of a pin representing a parameter group has been clicked.
|
|
|
| PinGraphicsItem (QGraphicsItem *parent, int index, Parameter *parameter) |
| Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.
|
|
| PinGraphicsItem (QGraphicsItem *parent, int index, ParameterGroup *parameterGroup, Parameter::PinType pinType) |
| Constructor of the PinGraphicsItem class. Creates a pin graphics item representing all parameters in the given parameter group.
|
|
| PinGraphicsItem (QGraphicsItem *parent, int index, ParameterGroup *parameterGroup, Parameter::PinType pinType, bool connected) |
| Constructor of the PinGraphicsItem class. Creates a pin graphics item representing only connected or unconnected parameters in the given parameter group.
|
|
| ~PinGraphicsItem () |
| Destructor of the PinGraphicsItem class.
|
|
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
| Paints the graphics item into a graphics view.
|
|
QPointF | center () const |
| Returns the center point of the pin item.
|
|
void | setEnabled (bool enabled) |
| Enables or disables the graphics item.
|
|
bool | setEnabled (Parameter::Type parameterType, Parameter::PinType pinType) |
| Enables the pin graphics item if it represents the given parameter type and pin type.
|
|
Parameter::PinType | getPinType () const |
| Returns the pin's type.
|
|
bool | represents (Parameter *parameter) const |
| Returns whether the pin represents the given parameter.
|
|
bool | represents (Parameter::Type parameterType) const |
| Returns whether the pin represents parameters of the given type.
|
|
| BaseRectItem (const QColor &color, bool actAsButton=false, QGraphicsItem *parent=0) |
| Constructor of the BaseRectItem class.
|
|
| ~BaseRectItem () |
| Destructor of the BaseRectItem class.
|
|
QRectF | boundingRect () const |
| Returns the bounding rectangle of the graphics item.
|
|
QColor | getColor () const |
| Returns the item's base color.
|
|
|
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| Event handler that reacts to mouse release events.
|
|
void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
| Event handler that reacts to context menu events.
|
|
void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
| Event handler that reacts to hover enter events.
|
|
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
| Event handler that reacts to hover leave events.
|
|
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| Event handler that reacts to mouse press events.
|
|
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| Event handler that reacts to mouse release events.
|
|
|
enum | ConnectedType { CT_All,
CT_Connected,
CT_NonConnected
} |
| Nested enumeration for the different types of connected states the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected. More...
|
|
|
void | removeParameter () |
| Removes the parameter (m_abstractParameter). E.g. on deletion.
|
|
|
void | fillMenu (QMenu *menu, ParameterGroup *parameterGroup) |
| Fills the given menu with actions and sub menus for the parameters in the given parameter group.
|
|
|
QColor | m_color |
| The item's base color.
|
|
bool | m_actAsButton |
| Flag that states whether the item should act as a button.
|
|
bool | m_hovered |
| Flag that states whether the item is currently hovered by the mouse pointer.
|
|
bool | m_clicked |
| Flag that states whether the item is currently clicked by the mouse pointer (i.e. a mouse button is pressed).
|
|
Class for graphical representation of node connector pins.
Inheritance Diagram
Nested enumeration for the different types of connected states the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected.
- Enumerator:
CT_All |
|
CT_Connected |
|
CT_NonConnected |
|
Frapper::PinGraphicsItem::PinGraphicsItem |
( |
QGraphicsItem * |
parent, |
|
|
int |
index, |
|
|
Parameter * |
parameter |
|
) |
| |
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.
Constructors and Destructors.
- Parameters
-
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameter | The parameter this pin item represents. |
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.
- Parameters
-
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameter | The parameter this pin item represents. |
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing all parameters in the given parameter group.
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the parameters in the given parameter group.
- Parameters
-
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameterGroup | The parameter group this pin item represents. |
pinType | The type that states whether the item represents input or output parameters in the given group. |
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameterGroup | The parameter group this pin item represents. |
pinType | The type that states whether the item represents input or output parameters in the given group. |
connected | Flag that states whether the item represents connected parameters only. |
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing only connected or unconnected parameters in the given parameter group.
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the parameters in the given parameter group.
- Parameters
-
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameterGroup | The parameter group this pin item represents. |
pinType | The type that states whether the item represents input or output parameters in the given group. |
connected | Flag that states whether the item represents connected or unconnected parameters. |
parent | The graphics item this item will be a child of. |
index | The index of the pin in a list of pins. |
parameterGroup | The parameter group this pin item represents. |
pinType | The type that states whether the item represents input or output parameters in the given group. |
connected | Flag that states whether the item represents connected parameters only. |
Frapper::PinGraphicsItem::~PinGraphicsItem |
( |
| ) |
|
void Frapper::PinGraphicsItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget = 0 |
|
) |
| |
|
virtual |
Paints the graphics item into a graphics view.
Public Functions.
- Parameters
-
painter | The object to use for painting. |
option | Style options for painting the graphics item. |
widget | The widget into which to paint the graphics item. |
Paints the graphics item into a graphics view.
- Parameters
-
painter | The object to use for painting. |
option | Style options for painting the graphics item. |
widget | The widget into which to paint the graphics item. |
Implements Frapper::BaseRectItem.
QPointF Frapper::PinGraphicsItem::center |
( |
| ) |
const |
Returns the center point of the pin item.
- Returns
- The center point of the pin item.
void Frapper::PinGraphicsItem::setEnabled |
( |
bool |
enabled | ) |
|
Enables or disables the graphics item.
- Parameters
-
enabled | The new enabled state for the item. |
Enables the pin graphics item if it represents the given parameter type and pin type.
- Parameters
-
parameterType | The parameter type of pins to enable. |
pinType | The pin type of pins to enable. |
- Returns
- True if the pin was enabled, otherwise False.
Returns the pin's type.
- Returns
- The pin's type.
bool Frapper::PinGraphicsItem::represents |
( |
Parameter * |
parameter | ) |
const |
Returns whether the pin represents the given parameter.
- Parameters
-
parameter | The parameter to check. |
- Returns
- True if the pin represents the given parameter, otherwise False.
bool Frapper::PinGraphicsItem::represents |
( |
Parameter::Type |
parameterType | ) |
const |
Returns whether the pin represents parameters of the given type.
- Parameters
-
parameterType | The parameter type to check. |
- Returns
- True if the pin represents parameters of the given type, otherwise False.
Signal that is emitted when a parameter represented by the pin has been clicked. Is either emitted when a pin representing one parameter only itself has been clicked, or when an entry in the context menu of a pin representing a parameter group has been clicked.
- Parameters
-
pinItem | The pin item emitting the signal. |
parameter | The parameter that was clicked. |
void Frapper::PinGraphicsItem::mouseReleaseEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
Event handler that reacts to mouse release events.
Protected Functions.
- Parameters
-
event | The object containing details about the event. |
Event handler that reacts to mouse release events.
- Parameters
-
event | The object containing details about the event. |
void Frapper::PinGraphicsItem::contextMenuEvent |
( |
QGraphicsSceneContextMenuEvent * |
event | ) |
|
|
protected |
Event handler that reacts to context menu events.
- Parameters
-
event | The object containing details about the event. |
void Frapper::PinGraphicsItem::fillMenu |
( |
QMenu * |
menu, |
|
|
ParameterGroup * |
parameterGroup |
|
) |
| |
|
private |
Fills the given menu with actions and sub menus for the parameters in the given parameter group.
Private Functions.
- Parameters
-
menu | The menu to which the actions and sub menus will be added. |
parameterGroup | The parameter group to create the context menu for. |
Fills the given menu with actions and sub menus for the parameters in the given parameter group.
- Parameters
-
menu | The menu to which the actions and sub menus will be added. |
parameterGroup | The parameter group to create the context menu for. |
void Frapper::PinGraphicsItem::removeParameter |
( |
| ) |
|
|
privateslot |
Removes the parameter (m_abstractParameter). E.g. on deletion.
The parameter or parameter group the pin represents.
bool Frapper::PinGraphicsItem::m_isGroup |
|
private |
Represented parameter is group.
bool Frapper::PinGraphicsItem::m_isRootGroup |
|
private |
Represented parameter is root group.
The type of parameters in a parameter group the pin represents.
The connected type of parameters in a parameter group the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected.
The parameter type to filter in the context menu.
The documentation for this class was generated from the following files: