15#ifndef KDGANTTGLOBAL_H
16#define KDGANTTGLOBAL_H
23#include "kdchart_export.h"
25#if (defined(__MINGW32__) || defined(__MINGW64__)) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) && (__GNUC_PATCHLEVEL__ == 0)
27int swprintf(
wchar_t *,
size_t,
const wchar_t *, ...);
28int vswprintf(
wchar_t *,
const wchar_t *, va_list);
31#ifndef KDAB_SET_OBJECT_NAME
44#define KDAB_SET_OBJECT_NAME(x) __kdab__dereference_for_methodcall(x).setObjectName(QLatin1String(#x))
47#if defined(_MSC_VER) && _MSC_VER <= 1300
48#define KDGANTT_DECLARE_PRIVATE_DERIVED(X) \
51 friend class Private; \
54 inline Private *d_func(); \
55 inline const Private *d_func() const; \
56 explicit inline X(Private *); \
61#define KDGANTT_DECLARE_PRIVATE_DERIVED(X) \
64 friend class Private; \
65 inline Private *d_func(); \
66 inline const Private *d_func() const; \
67 explicit inline X(Private *); \
73#if defined(_MSC_VER) && _MSC_VER <= 1300
74#define KDGANTT_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType) \
77 friend class Private; \
80 inline Private *d_func(); \
81 inline const Private *d_func() const; \
82 explicit inline X(Private *, ParentType); \
87#define KDGANTT_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType) \
90 friend class Private; \
91 inline Private *d_func(); \
92 inline const Private *d_func() const; \
93 explicit inline X(Private *, ParentType); \
99#define KDGANTT_DECLARE_PRIVATE_DERIVED_QWIDGET(X) \
100 KDGANTT_DECLARE_PRIVATE_DERIVED_PARENT(X, QWidget *)
102#define KDGANTT_DECLARE_PRIVATE_BASE_VALUE(X) \
104 inline void swap(X &other) \
106 qSwap(_d, other._d); \
111 friend class Private; \
116 const Private *d_func() const \
125#if defined(_MSC_VER) && _MSC_VER <= 1300
126#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X) \
129 friend class Private; \
136 const Private *d_func() const \
140 explicit inline X(Private *); \
146#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X) \
149 friend class Private; \
154 const Private *d_func() const \
158 explicit inline X(Private *); \
165#if defined(_MSC_VER) && _MSC_VER <= 1300
166#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X) \
169 friend class Private; \
176 const Private *d_func() const \
180 explicit inline X(Private *, QWidget *); \
186#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X) \
189 friend class Private; \
194 const Private *d_func() const \
198 explicit inline X(Private *, QWidget *); \
209#include <QtAlgorithms>
212#define KDGANTT_DECLARE_SWAP_SPECIALISATION(X) \
215 inline void qSwap<X>(X & lhs, X & rhs) \
222 inline void swap<X>(X & lhs, X &rhs) \
228#define KDGANTT_DECLARE_SWAP_SPECIALISATION(X) \
231 inline void qSwap<X>(X & lhs, X & rhs) \
238#define KDGANTT_DECLARE_SWAP_SPECIALISATION_DERIVED(X) \
239 KDGANTT_DECLARE_SWAP_SPECIALISATION(X)
241#define KDGANTT_DECLARE_SWAP_BASE(X) \
243 void doSwap(X &other) \
245 qSwap(_d, other._d); \
248#define KDGANTT_DECLARE_SWAP_DERIVED(X) \
249 void swap(X &other) \
254#if defined(Q_OS_WIN) && defined(QT_DLL)
255#if defined(_MSC_VER) && _MSC_VER >= 1300
293 inline Span(qreal start, qreal length)
299 : m_start(other.m_start)
300 , m_length(other.m_length)
306 m_start = other.m_start;
307 m_length = other.m_length;
321 m_length = m_start - end;
325 return m_start + m_length;
339 return m_start >= 0.;
344 return m_start == other.m_start && m_length == other.m_length;
348 const qreal new_start = qMin(start(), other.
start());
349 return Span(new_start, (end() < other.
end()) ? other.
end() - new_start : end() - new_start);
353inline bool operator==(
const Span &s1,
const Span &s2)
393 bool isValid()
const;
410#ifndef QT_NO_DEBUG_STREAM
bool equals(const DateTimeSpan &other) const
void setStart(const QDateTime &start)
void setEnd(const QDateTime &end)
A class representing a start point and a length.
Span & operator=(const Span &other)
Span expandedTo(const Span &other) const
bool equals(const Span &other) const
void setStart(qreal start)
Span(qreal start, qreal length)
void setLength(qreal length)
QDebug KDGANTT_EXPORT operator<<(QDebug dbg, KDGantt::ItemDataRole r)
QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(KDGantt::Span, Q_MOVABLE_TYPE)
T & __kdab__dereference_for_methodcall(T &o)
bool operator!=(const Span &s1, const Span &s2)
ItemDataRole
KDGantt::KDGanttRoleBase The base value used for the KDGantt role enum values.