KGantt::Constraint

Search for usage in LXR

KGantt::Constraint Class Reference

#include <kganttconstraint.h>

Public Types

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

Public Member Functions

 Constraint ()
 
 Constraint (const Constraint &other)
 
 Constraint (const QModelIndex &idx1, const QModelIndex &idx2, Type type=TypeSoft, RelationType relType=FinishStart, const DataMap &datamap=DataMap())
 
 ~Constraint ()
 
bool compareIndexes (const Constraint &other) const
 
QVariant data (int role) const
 
QMap< int, QVariantdataMap () 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
 

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.

Member Typedef Documentation

◆ DataMap

Definition at line 63 of file kganttconstraint.h.

Member Enumeration Documentation

◆ ConstraintDataRole

enum KGantt::Constraint::ConstraintDataRole

Definition at line 57 of file kganttconstraint.h.

◆ RelationType

enum KGantt::Constraint::RelationType

Definition at line 45 of file kganttconstraint.h.

◆ Type

enum KGantt::Constraint::Type

Definition at line 40 of file kganttconstraint.h.

Constructor & Destructor Documentation

◆ Constraint() [1/3]

Constraint::Constraint ( )

Default constructor, created an invalid constraint.

Definition at line 48 of file kganttconstraint.cpp.

◆ Constraint() [2/3]

Constraint::Constraint ( const QModelIndex & idx1,
const QModelIndex & idx2,
Constraint::Type type = TypeSoft,
Constraint::RelationType relationType = FinishStart,
const DataMap & datamap = DataMap() )

Constructor. Creates a dependency for idx2 on idx1.

Parameters
typecontrols if the constraint is a soft one that is allowed to be broken (ie, go backwards in time) or a hard constraint that will not allow the user to move an item so that the constraint would have to go backwards. The default is TypeSoft.

Actually enforcing hard constraints is the responsibility of the AbstractGrid subclass used in the view.

Parameters
relationTypedefines how the tasks depends on each other. relationType can be FinishStart (default), FinishFinish, StartStart or StartFinish.

Definition at line 33 of file kganttconstraint.cpp.

◆ Constraint() [3/3]

Constraint::Constraint ( const Constraint & other)

Copy-Constructor.

Definition at line 53 of file kganttconstraint.cpp.

◆ ~Constraint()

Constraint::~Constraint ( )

Destructor

Definition at line 58 of file kganttconstraint.cpp.

Member Function Documentation

◆ compareIndexes()

bool Constraint::compareIndexes ( const Constraint & other) const

Definition at line 108 of file kganttconstraint.cpp.

◆ data()

QVariant Constraint::data ( int role) const
Returns
The data associated with this index for the specified role.
Parameters
roleThe role to fetch the data for.
See also
ConstraintDataRole

Definition at line 88 of file kganttconstraint.cpp.

◆ dataMap()

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

Definition at line 103 of file kganttconstraint.cpp.

◆ debug()

QDebug Constraint::debug ( QDebug dbg) const

Definition at line 132 of file kganttconstraint.cpp.

◆ endIndex()

QModelIndex Constraint::endIndex ( ) const
Returns
The constrained index

Definition at line 83 of file kganttconstraint.cpp.

◆ hash()

uint Constraint::hash ( ) const

Definition at line 120 of file kganttconstraint.cpp.

◆ operator!=()

bool KGantt::Constraint::operator!= ( const Constraint & other) const
inline

Definition at line 138 of file kganttconstraint.h.

◆ operator=()

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

Assignment operator.

Definition at line 62 of file kganttconstraint.cpp.

◆ operator==()

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 114 of file kganttconstraint.cpp.

◆ relationType()

Constraint::RelationType Constraint::relationType ( ) const

This is unused for now.

Definition at line 73 of file kganttconstraint.cpp.

◆ setData()

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

Set data on this index for the specified role.

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

Definition at line 93 of file kganttconstraint.cpp.

◆ setDataMap()

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 98 of file kganttconstraint.cpp.

◆ startIndex()

QModelIndex Constraint::startIndex ( ) const
Returns
The dependency index

Definition at line 78 of file kganttconstraint.cpp.

◆ type()

Constraint::Type Constraint::type ( ) const

This is unused for now.

Definition at line 68 of file kganttconstraint.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.