Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Private Attributes
Visualization::ItemRegion Class Reference

Public Types

enum  PositionConstraint { NoConstraints = 0x0 , Below = 0x1 , Above = 0x2 , LeftOf = 0x4 , RightOf = 0x8 , Overlap = 0x10 }
 
using PositionConstraints = QFlags< PositionConstraint >
 

Public Member Functions

 ItemRegion (const QRect &region={})
 
virtual ~ItemRegion ()
 
Cursorcursor () const
 
qreal distanceTo (const QPointF &point)
 
Itemitem () const
 
QRect & region ()
 
PositionConstraints satisfiedPositionConstraints (const QPoint &point) const
 Returns all position constraints with respect to the point point satisfied by this region. More...
 
bool satisfiesConstraint (PositionConstraint constraint, QRect rect) const
 Returns whether the region occupies a part directly corresponding to the specified constraint. More...
 
void setCursor (Cursor *cursor)
 
void setItem (Item *item)
 
void setRegion (const QRect &region)
 

Private Attributes

Cursorcursor_
 
Itemitem_
 
QRect region_
 

Member Typedef Documentation

◆ PositionConstraints

Member Enumeration Documentation

◆ PositionConstraint

Enumerator
NoConstraints 
Below 
Above 
LeftOf 
RightOf 
Overlap 

Constructor & Destructor Documentation

◆ ItemRegion()

Visualization::ItemRegion::ItemRegion ( const QRect &  region = {})

◆ ~ItemRegion()

Visualization::ItemRegion::~ItemRegion ( )
virtual

Member Function Documentation

◆ cursor()

Cursor * Visualization::ItemRegion::cursor ( ) const
inline

◆ distanceTo()

qreal Visualization::ItemRegion::distanceTo ( const QPointF &  point)

◆ item()

Item * Visualization::ItemRegion::item ( ) const
inline

◆ region()

QRect & Visualization::ItemRegion::region ( )
inline

◆ satisfiedPositionConstraints()

ItemRegion::PositionConstraints Visualization::ItemRegion::satisfiedPositionConstraints ( const QPoint &  point) const

Returns all position constraints with respect to the point point satisfied by this region.

The returned constraints are from the region's point of view, e.g. a constraint LeftOf means that the region is left of the specified point.

◆ satisfiesConstraint()

bool Visualization::ItemRegion::satisfiesConstraint ( PositionConstraint  constraint,
QRect  rect 
) const

Returns whether the region occupies a part directly corresponding to the specified constraint.

◆ setCursor()

void Visualization::ItemRegion::setCursor ( Cursor cursor)
inline

◆ setItem()

void Visualization::ItemRegion::setItem ( Item item)
inline

◆ setRegion()

void Visualization::ItemRegion::setRegion ( const QRect &  region)
inline

Member Data Documentation

◆ cursor_

Cursor* Visualization::ItemRegion::cursor_
private

◆ item_

Item* Visualization::ItemRegion::item_
private

◆ region_

QRect Visualization::ItemRegion::region_
private