KD Chart API Documentation 3.1
|
The ConstraintModel keeps track of the interdependencies between gantt items in a View. More...
#include <kdganttconstraintmodel.h>
Signals | |
void | constraintAdded (const KDGantt::Constraint &) |
void | constraintRemoved (const KDGantt::Constraint &) |
The ConstraintModel keeps track of the interdependencies between gantt items in a View.
Definition at line 21 of file kdganttconstraintmodel.h.
Constructor.
Creates an empty ConstraintModel with parent parent
Definition at line 61 of file kdganttconstraintmodel.cpp.
|
override |
Destroys this ConstraintModel.
Definition at line 77 of file kdganttconstraintmodel.cpp.
|
virtual |
Adds the constraint c to this ConstraintModel If the Constraint c is already in this ConstraintModel, nothing happens.
Subclassing ConstraintModel and overriding addConstraint() and removeConstraint() can provide re-entrancy issues in the ConstraintModel<->ConstraintProxy interaction. Therefore it is recommended to better subclass GraphicsView and override addConstraint() there.
Definition at line 108 of file kdganttconstraintmodel.cpp.
References constraintAdded(), d, KDGantt::Constraint::dataMap(), KDGantt::Constraint::endIndex(), QObject::Q_EMIT(), QObject::qobject_cast(), removeConstraint(), and KDGantt::Constraint::startIndex().
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
void ConstraintModel::cleanup | ( | ) |
Not used.
Definition at line 170 of file kdganttconstraintmodel.cpp.
References d, KDGantt::Constraint::endIndex(), QSet::insert(), QModelIndex::isValid(), QObject::qobject_cast(), 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 161 of file kdganttconstraintmodel.cpp.
References constraints(), QObject::qobject_cast(), and removeConstraint().
|
signal |
|
signal |
QList< Constraint > ConstraintModel::constraints | ( | ) | const |
Definition at line 185 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 194 of file kdganttconstraintmodel.cpp.
References d, KDGantt::Constraint::endIndex(), QSet::insert(), QModelIndex::isValid(), QList::push_back(), QObject::qobject_cast(), KDGantt::Constraint::startIndex(), and QSet::values().
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 221 of file kdganttconstraintmodel.cpp.
References KDGantt::Constraint::compareIndexes(), d, and QObject::qobject_cast().
Referenced by hasConstraint(), and KDAB_SCOPED_UNITTEST_SIMPLE().
|
inline |
Definition at line 64 of file kdganttconstraintmodel.h.
References hasConstraint(), and QObject::qobject_cast().
|
virtual |
Removes the Constraint c from this ConstraintModel.
If c was found and removed, the signal constraintRemoved(const Constraint&) is emitted.
Definition at line 137 of file kdganttconstraintmodel.cpp.
References KDGantt::Constraint::compareIndexes(), constraintRemoved(), d, KDGantt::Constraint::endIndex(), QObject::Q_EMIT(), QObject::qobject_cast(), and KDGantt::Constraint::startIndex().
Referenced by addConstraint(), clear(), and KDAB_SCOPED_UNITTEST_SIMPLE().