Public Types | Public Member Functions

KDGantt::Constraint Class Reference

A class used to represent a dependency. More...

#include <kdganttconstraint.h>

Collaboration diagram for KDGantt::Constraint:
Collaboration graph

List of all members.

Public Types

enum  ConstraintDataRole {
  ValidConstraintPen = Qt::UserRole,
typedef QMap< int, QVariant > DataMap
enum  RelationType {
  FinishStart = 0,
  FinishFinish = 1,
  StartStart = 2,
  StartFinish = 3
enum  Type {
  TypeSoft = 0,
  TypeHard = 1

Public Member Functions

bool compareIndexes (const Constraint &other) const
 Constraint (const QModelIndex &idx1, const QModelIndex &idx2, Type type=TypeSoft, RelationType=FinishStart, const DataMap &dataMap=DataMap())
 Constraint ()
 Constraint (const Constraint &other)
QVariant data (int role) const
QMap< int, QVariant > dataMap () const
QDebug debug (QDebug dbg) const
QModelIndex endIndex () const
uint hash () const
bool operator!= (const Constraint &other) const
Constraintoperator= (const Constraint &other)
bool operator== (const Constraint &other) const
RelationType relationType () const
void setData (int role, const QVariant &value)
void setDataMap (const QMap< int, QVariant > &datamap)
QModelIndex startIndex () const
Type type () const
 ~Constraint ()

Detailed Description

A class used to represent a dependency.

Instances of this class represent a dependency between the data items pointed to by a start-QModelIndex and an end-QModelIndex.

Definition at line 38 of file kdganttconstraint.h.

Member Typedef Documentation

typedef QMap<int,QVariant> KDGantt::Constraint::DataMap

Definition at line 63 of file kdganttconstraint.h.

Member Enumeration Documentation

Data roles used when specifying the pen to draw constraints with.

See also:

Definition at line 54 of file kdganttconstraint.h.


Definition at line 46 of file kdganttconstraint.h.

This enum is unused for now.


Definition at line 41 of file kdganttconstraint.h.

Constructor & Destructor Documentation

Constraint::Constraint (  )

Default constructor, created an invalid constraint.

Definition at line 93 of file kdganttconstraint.cpp.

KDGantt::Constraint::Constraint ( const QModelIndex &  idx1,
const QModelIndex &  idx2,
Type  type = TypeSoft,
RelationType  = FinishStart,
const DataMap dataMap = DataMap() 
Constraint::Constraint ( const Constraint other )


Definition at line 99 of file kdganttconstraint.cpp.

Constraint::~Constraint (  )


Definition at line 105 of file kdganttconstraint.cpp.

Member Function Documentation

bool Constraint::compareIndexes ( const Constraint other ) const
QVariant Constraint::data ( int  role ) const
The data associated with this index for the specified role.
roleThe role to fetch the data for.
See also:

Definition at line 144 of file kdganttconstraint.cpp.

Referenced by KDGantt::ConstraintGraphicsItem::ganttToolTip().

QMap< int, QVariant > Constraint::dataMap (  ) const
all the data set on this constraint.
See also:

Definition at line 169 of file kdganttconstraint.cpp.

Referenced by KDGantt::ConstraintModel::addConstraint(), and KDGantt::ConstraintGraphicsItem::proxyConstraint().

QDebug Constraint::debug ( QDebug  dbg ) const

Definition at line 203 of file kdganttconstraint.cpp.

Referenced by operator<<().

QModelIndex Constraint::endIndex (  ) const
uint Constraint::hash (  ) const

Definition at line 191 of file kdganttconstraint.cpp.

References KDGantt::qHash().

Referenced by KDGantt::qHash().

bool KDGantt::Constraint::operator!= ( const Constraint other ) const

Definition at line 90 of file kdganttconstraint.h.

References KDGantt::operator==().

Constraint & Constraint::operator= ( const Constraint other )

Assignment operator.

Definition at line 110 of file kdganttconstraint.cpp.

bool Constraint::operator== ( const Constraint other ) const

Compare two Constraint objects. Two Constraints are equal if the have the same start and end indexes

Definition at line 184 of file kdganttconstraint.cpp.

Constraint::RelationType Constraint::relationType (  ) const
void Constraint::setData ( int  role,
const QVariant &  value 

Set data on this index for the specified role.

roleThe role to set the data for.
valueThe data to set on the index.
See also:

Definition at line 154 of file kdganttconstraint.cpp.

void Constraint::setDataMap ( const QMap< int, QVariant > &  datamap )

Set data on this constraint to the keys/values in datamap. Clears any existing data from the constraint.

Definition at line 162 of file kdganttconstraint.cpp.

QModelIndex Constraint::startIndex (  ) const
Constraint::Type Constraint::type (  ) const

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products