12#include "kdganttconstraint_p.h"
36Constraint::Private::Private()
40Constraint::Private::Private(
const Private &other)
45 , relationType(other.relationType)
75 Q_ASSERT_X(idx1 != idx2 || !idx1.
isValid(),
"Constraint::Constraint",
"cannot create a constraint with idx1 == idx2");
111 return d->relationType;
132 return d->
data.value(role);
142 d->
data.insert(role, value);
173 return (*d).equals(*(other.d));
179 return ::qHash(d->start) ^
::qHash(d->end) ^
::qHash(
static_cast<uint
>(d->type));
182#ifndef QT_NO_DEBUG_STREAM
191 dbg <<
"KDGantt::Constraint[ start=" << d->start <<
"end=" << d->end <<
"relationType=" << d->relationType <<
"], data=" << d->
data;
197#ifndef KDAB_NO_UNIT_TESTS
199#include <QStandardItemModel>
201#include "unittest/test.h"
215 assertTrue(c1 == c2);
217 assertTrue(c1 == c3);
219 assertTrue(c2 == c3);
222 assertFalse(c2 == c4);
225 assertFalse(c4 == c5);
230 assertFalse(c4 == c5);
QDebug operator<<(QDebug dbg, const KDChart::ThreeDBarAttributes &a)
A class used to represent a dependency.
QVariant data(int role) const
void setDataMap(const QMap< int, QVariant > &datamap)
Set data on this constraint to the keys/values in datamap.
QDebug debug(QDebug dbg) const
Type
This enum is unused for now.
QModelIndex endIndex() const
Constraint & operator=(const Constraint &other)
Assignment operator.
Type type() const
This is unused for now.
bool operator==(const Constraint &other) const
Compare two Constraint objects.
bool compareIndexes(const Constraint &other) const
RelationType relationType() const
This is unused for now.
QModelIndex startIndex() const
Constraint()
Default constructor, created an invalid constraint.
QMap< int, QVariant > dataMap() const
void setData(int role, const QVariant &value)
Set data on this index for the specified role.
KDAB_SCOPED_UNITTEST_SIMPLE(KDGantt, Constraint, "test")
uint qHash(const Constraint &c)
bool removeRow(int row, const QModelIndex &parent)
bool isValid() const const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override