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.

Definition at line 34 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.

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.

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)


Definition at line 53 of file kganttconstraint.cpp.

◆ ~Constraint()

Constraint::~Constraint ( )


Definition at line 58 of file kganttconstraint.cpp.

Member Function Documentation

◆ data()

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

◆ dataMap()

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

Definition at line 103 of file kganttconstraint.cpp.

◆ endIndex()

QModelIndex Constraint::endIndex ( ) const
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=()

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.

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

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
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 Thu Feb 15 2024 03:53:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.