28 #ifndef QT_VERSION_CHECK 29 # define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) 33 #if QT_VERSION < QT_VERSION_CHECK(4,3,0) 34 # error "The minimum required version of Qt for KD Gantt is 4.3.0" 87 : m_start( start ), m_end( end )
102 if (
this != &other ) {
103 m_start = other.m_start;
111 return m_start.isValid() && m_end.isValid();
116 return m_start==other.m_start && m_end==other.m_end;
119 #ifndef QT_NO_DEBUG_STREAM 129 default: dbg << static_cast<Qt::ItemDataRole>(r);
143 default: dbg << static_cast<int>(t);
150 dbg <<
"KDGantt::Span[ start="<<s.
start()<<
" length="<<s.
length()<<
"]";
155 dbg <<
"KDGantt::DateTimeSpan[ start="<<s.
start()<<
" end="<<s.
end()<<
"]";
161 #ifndef KDAB_NO_UNIT_TESTS 167 os <<
"Span[ start="<<span.
start()<<
", length="<<span.
length()<<
"]";
174 os <<
"DateTimeSpan[ start="<<span.
start().toString().toLatin1().constData()
175 <<
", end="<<span.
end().toString().toLatin1().constData() <<
"]";
177 os <<
"DateTimeSpan[ start="<<span.
start().toString().toStdString()
178 <<
", end="<<span.
end().toString().toStdString() <<
"]";
198 QDateTime dt = QDateTime::currentDateTime();
201 s1.
setEnd( dt.addDays( 1 ) );
QDebug operator<<(QDebug dbg, KDGantt::ItemDataRole r)
void setStart(qreal start)
DateTimeSpan & operator=(const DateTimeSpan &other)
A class representing a start point and a length.
#define assertNotEqual(x, y)
KDAB_SCOPED_UNITTEST_SIMPLE(KDGantt, Span,"test")
void setLength(qreal length)
void setEnd(const QDateTime &end)
void setStart(const QDateTime &start)
bool equals(const DateTimeSpan &other) const
#define assertEqual(x, y)