KD Chart 2
[rev.2.7]
|
#include <kdganttconstraintmodel.h>
Signals | |
void | constraintAdded (const KDGantt::Constraint &) |
void | constraintRemoved (const KDGantt::Constraint &) |
Public Member Functions | |
virtual void | addConstraint (const Constraint &c) |
Subclassing ConstraintModel and overriding addConstraint() and removeConstraint() can provide re-entrancy issues in the ConstraintModel<->ConstraintProxy interaction. More... | |
void | cleanup () |
void | clear () |
ConstraintModel (QObject *parent=0) | |
QList< Constraint > | constraints () const |
QList< Constraint > | constraintsForIndex (const QModelIndex &) const |
bool | hasConstraint (const Constraint &c) const |
bool | hasConstraint (const QModelIndex &s, const QModelIndex &e) const |
virtual bool | removeConstraint (const Constraint &c) |
~ConstraintModel () override | |
The ConstraintModel keeps track of the interdependencies between gantt items in a View.
Definition at line 33 of file kdganttconstraintmodel.h.
|
explicit |
Constructor. Creates an empty ConstraintModel with parent parent
Definition at line 72 of file kdganttconstraintmodel.cpp.
|
override |
Destroys this ConstraintModel
Definition at line 86 of file kdganttconstraintmodel.cpp.
|
virtual |
Subclassing ConstraintModel and overriding addConstraint() and removeConstraint() can provide re-entrancy issues in the ConstraintModel<->ConstraintProxy interaction.
Therefore it is recommed to better subclass GraphicsView and override addConstraint() there.
Adds the constraint c to this ConstraintModel If the Constraint c is already in this ConstraintModel, nothing happens.
Definition at line 115 of file kdganttconstraintmodel.cpp.
References constraintAdded(), d, KDGantt::Constraint::dataMap(), KDGantt::Constraint::endIndex(), removeConstraint(), and KDGantt::Constraint::startIndex().
Referenced by KDGantt::GraphicsView::addConstraint(), and KDAB_SCOPED_UNITTEST_SIMPLE().
void ConstraintModel::cleanup | ( | ) |
Not used
Definition at line 179 of file kdganttconstraintmodel.cpp.
References d, KDGantt::Constraint::endIndex(), and KDGantt::Constraint::startIndex().
void ConstraintModel::clear | ( | ) |
Removes all Constraints from this model The signal constraintRemoved(const Constraint&) is emitted for every Constraint that is removed.
Definition at line 170 of file kdganttconstraintmodel.cpp.
References constraints(), and removeConstraint().
|
signal |
Referenced by addConstraint().
|
signal |
Referenced by removeConstraint().
QList< Constraint > ConstraintModel::constraints | ( | ) | const |
Definition at line 194 of file kdganttconstraintmodel.cpp.
References d.
Referenced by clear(), KDAB_SCOPED_UNITTEST_SIMPLE(), and operator<<().
QList< Constraint > ConstraintModel::constraintsForIndex | ( | const QModelIndex & | idx | ) | const |
Definition at line 203 of file kdganttconstraintmodel.cpp.
References d, KDGantt::Constraint::endIndex(), and KDGantt::Constraint::startIndex().
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
bool ConstraintModel::hasConstraint | ( | const Constraint & | c | ) | const |
Returns true if a Constraint with start s and end e exists, otherwise false.
Definition at line 228 of file kdganttconstraintmodel.cpp.
References KDGantt::Constraint::compareIndexes(), and d.
Referenced by KDGantt::GraphicsView::addConstraint(), and KDAB_SCOPED_UNITTEST_SIMPLE().
bool KDGantt::ConstraintModel::hasConstraint | ( | const QModelIndex & | s, |
const QModelIndex & | e | ||
) | const |
Definition at line 69 of file kdganttconstraintmodel.h.
References operator<<().
|
virtual |
Removes the Constraint c from this ConstraintModel. If c was found and removed, the signal constraintRemoved(const Constraint&) is emitted.
Definition at line 144 of file kdganttconstraintmodel.cpp.
References KDGantt::Constraint::compareIndexes(), constraintRemoved(), d, KDGantt::Constraint::endIndex(), and KDGantt::Constraint::startIndex().
Referenced by addConstraint(), KDGantt::GraphicsView::addConstraint(), clear(), and KDAB_SCOPED_UNITTEST_SIMPLE().