Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
OOInteraction::SetExpressionCursorEvent Class Reference
Inheritance diagram for OOInteraction::SetExpressionCursorEvent:
Visualization::CustomSceneEvent

Public Member Functions

 SetExpressionCursorEvent (Visualization::Item *parentContainer, Model::Node *node, int offset)
 
virtual void execute ()
 
- Public Member Functions inherited from Visualization::CustomSceneEvent
 CustomSceneEvent (EventFunction f)
 
 CustomSceneEvent (QEvent::Type type)
 
virtual ~CustomSceneEvent ()
 
void setEventFunction (EventFunction f)
 

Static Public Attributes

static const QEvent::Type EventType = static_cast<QEvent::Type> (QEvent::registerEventType())
 
- Static Public Attributes inherited from Visualization::CustomSceneEvent
static const QEvent::Type EventType = static_cast<QEvent::Type> (QEvent::registerEventType())
 

Private Member Functions

bool tryToSetOffset (Visualization::Item *item)
 

Private Attributes

Model::Nodenode_
 
int offset_
 
QList< Visualization::Item * > parentContainerChain_
 Instead of just storing the visualization that contains the visualization node, this field stores all ancestors of that visualization. More...
 
bool reposted_ {}
 

Additional Inherited Members

- Public Types inherited from Visualization::CustomSceneEvent
using EventFunction = std::function< void()>
 

Constructor & Destructor Documentation

◆ SetExpressionCursorEvent()

OOInteraction::SetExpressionCursorEvent::SetExpressionCursorEvent ( Visualization::Item parentContainer,
Model::Node node,
int  offset 
)

Member Function Documentation

◆ execute()

void OOInteraction::SetExpressionCursorEvent::execute ( )
virtual

Reimplemented from Visualization::CustomSceneEvent.

◆ tryToSetOffset()

bool OOInteraction::SetExpressionCursorEvent::tryToSetOffset ( Visualization::Item item)
private

Member Data Documentation

◆ EventType

const QEvent::Type OOInteraction::SetExpressionCursorEvent::EventType = static_cast<QEvent::Type> (QEvent::registerEventType())
static

◆ node_

Model::Node* OOInteraction::SetExpressionCursorEvent::node_
private

◆ offset_

int OOInteraction::SetExpressionCursorEvent::offset_
private

◆ parentContainerChain_

QList<Visualization::Item*> OOInteraction::SetExpressionCursorEvent::parentContainerChain_
private

Instead of just storing the visualization that contains the visualization node, this field stores all ancestors of that visualization.

The reason is that when this cursor event object is constructed, before an update, a parent container is provided that might turn out to be the wrong container after the update. For example the expression node, might be recognized as a special expression and its visualization might be transferred somewhere else.

Having the entire chain of parents makes it possible to assure that:

  • The container that was specified was not deleted.
  • The new place where this node is visualized is properly given the cursor.

◆ reposted_

bool OOInteraction::SetExpressionCursorEvent::reposted_ {}
private