82 m_start = other.m_start;
90 return m_start.isValid() && m_end.isValid();
95 return m_start == other.m_start && m_end == other.m_end;
98 #ifndef QT_NO_DEBUG_STREAM
104 dbg <<
"KDGantt::StartTimeRole";
107 dbg <<
"KDGantt::EndTimeRole";
110 dbg <<
"KDGantt::TaskCompletionRole";
113 dbg <<
"KDGantt::ItemTypeRole";
116 dbg <<
"KDGantt::LegendRole";
119 dbg << static_cast<Qt::ItemDataRole>(r);
128 dbg <<
"KDGantt::TypeNone";
131 dbg <<
"KDGantt::TypeEvent";
134 dbg <<
"KDGantt::TypeTask";
137 dbg <<
"KDGantt::TypeSummary";
140 dbg <<
"KDGantt::TypeMulti";
143 dbg <<
"KDGantt::TypeUser";
146 dbg << static_cast<int>(t);
153 dbg <<
"KDGantt::Span[ start=" << s.
start() <<
" length=" << s.
length() <<
"]";
158 dbg <<
"KDGantt::DateTimeSpan[ start=" << s.
start() <<
" end=" << s.
end() <<
"]";
164 #ifndef KDAB_NO_UNIT_TESTS
170 os <<
"Span[ start=" << span.
start() <<
", length=" << span.
length() <<
"]";
177 os <<
"DateTimeSpan[ start=" << span.
start().toString().toLatin1().constData()
178 <<
", end=" << span.
end().toString().toLatin1().constData() <<
"]";
180 os <<
"DateTimeSpan[ start=" << span.
start().toString().toStdString()
181 <<
", end=" << span.
end().toString().toStdString() <<
"]";
186 #include "unittest/test.h"
203 QDateTime dt = QDateTime::currentDateTime();
205 assertTrue(dt.isValid());
214 assertNotEqual(s1, s3);
bool equals(const DateTimeSpan &other) const
void setStart(const QDateTime &start)
DateTimeSpan & operator=(const DateTimeSpan &other)
void setEnd(const QDateTime &end)
A class representing a start point and a length.
void setStart(qreal start)
void setLength(qreal length)
KDAB_SCOPED_UNITTEST_SIMPLE(KDGantt, Span, "test")
QDebug operator<<(QDebug dbg, KDGantt::ItemDataRole r)
ItemDataRole
The values of this enum are used for the special data roles for gantt items.
ItemType
The values of this enum are used to represent the different types of gantt items that KDGantt underst...