21#include "kgantt_export.h"
23#if (defined(__MINGW32__) || defined(__MINGW64__)) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) && (__GNUC_PATCHLEVEL__ == 0)
25int swprintf (
wchar_t *,
size_t,
const wchar_t *, ...);
26int vswprintf(
wchar_t *,
const wchar_t *, va_list);
29#ifndef KDAB_SET_OBJECT_NAME
31inline T & __kdab__dereference_for_methodcall( T & o ) {
36inline T & __kdab__dereference_for_methodcall( T * o ) {
40#define KDAB_SET_OBJECT_NAME( x ) __kdab__dereference_for_methodcall( x ).setObjectName( QLatin1String( #x ) )
43#if defined(_MSC_VER) && _MSC_VER <= 1300
44#define KGANTT_DECLARE_PRIVATE_DERIVED( X ) \
47 friend class Private; \
49 inline Private * d_func(); \
50 inline const Private * d_func() const; \
51 explicit inline X( Private * ); \
55#define KGANTT_DECLARE_PRIVATE_DERIVED( X ) \
58 friend class Private; \
59 inline Private * d_func(); \
60 inline const Private * d_func() const; \
61 explicit inline X( Private * ); \
66#if defined(_MSC_VER) && _MSC_VER <= 1300
67#define KGANTT_DECLARE_PRIVATE_DERIVED_PARENT( X, ParentType ) \
70 friend class Private; \
72 inline Private * d_func(); \
73 inline const Private * d_func() const; \
74 explicit inline X( Private *, ParentType ); \
78#define KGANTT_DECLARE_PRIVATE_DERIVED_PARENT( X, ParentType ) \
81 friend class Private; \
82 inline Private * d_func(); \
83 inline const Private * d_func() const; \
84 explicit inline X( Private *, ParentType ); \
89#define KGANTT_DECLARE_PRIVATE_DERIVED_QWIDGET( X ) \
90 KGANTT_DECLARE_PRIVATE_DERIVED_PARENT( X, QWidget* )
92#define KGANTT_DECLARE_PRIVATE_BASE_VALUE( X ) \
94 inline void swap( X & other ) { qSwap( _d, other._d ); } \
97 friend class Private; \
98 Private * d_func() { return _d; } \
99 const Private * d_func() const { return _d; } \
104#if defined(_MSC_VER) && _MSC_VER <= 1300
105#define KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( X ) \
108 friend class Private; \
110 Private * d_func() { return _d; } \
111 const Private * d_func() const { return _d; } \
112 explicit inline X( Private * ); \
117#define KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( X ) \
120 friend class Private; \
121 Private * d_func() { return _d; } \
122 const Private * d_func() const { return _d; } \
123 explicit inline X( Private * ); \
129#if defined(_MSC_VER) && _MSC_VER <= 1300
130#define KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET( X ) \
133 friend class Private; \
135 Private * d_func() { return _d; } \
136 const Private * d_func() const { return _d; } \
137 explicit inline X( Private *, QWidget* ); \
142#define KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET( X ) \
145 friend class Private; \
146 Private * d_func() { return _d; } \
147 const Private * d_func() const { return _d; } \
148 explicit inline X( Private *, QWidget* ); \
161#include <QtAlgorithms>
164#define KGANTT_DECLARE_SWAP_SPECIALISATION( X ) \
166 template <> inline void qSwap<X>( X & lhs, X & rhs ) \
167 { lhs.swap( rhs ); } \
170 template <> inline void swap<X>( X & lhs, X & rhs ) \
171 { lhs.swap( rhs ); } \
174#define KGANTT_DECLARE_SWAP_SPECIALISATION( X ) \
176 template <> inline void qSwap<X>( X & lhs, X & rhs ) \
177 { lhs.swap( rhs ); } \
181#define KGANTT_DECLARE_SWAP_SPECIALISATION_DERIVED( X ) \
182 KGANTT_DECLARE_SWAP_SPECIALISATION( X )
184#define KGANTT_DECLARE_SWAP_BASE( X ) \
186 void doSwap( X& other ) \
187 { qSwap( _d, other._d); }
189#define KGANTT_DECLARE_SWAP_DERIVED( X ) \
190 void swap( X& other ) { doSwap( other ); }
192#if defined(Q_OS_WIN) && defined(QT_DLL)
193#if defined(_MSC_VER) && _MSC_VER >= 1300
244 inline Span() : m_start( -1 ), m_length( 0 ) {}
245 inline Span( qreal
start, qreal length ) : m_start(
start ), m_length( length ) {}
246 inline Span(
const Span& other ) : m_start(other.m_start), m_length(other.m_length) {}
248 inline Span& operator=(
const Span& other ) { m_start=other.m_start; m_length=other.m_length;
return *
this; }
250 inline void setStart( qreal
start ) { m_start=
start; }
251 inline qreal
start()
const {
return m_start; }
252 inline void setEnd( qreal end ) { m_length = m_start-end; }
253 inline qreal end()
const {
return m_start+m_length; }
255 inline void setLength( qreal length ) { m_length=length; }
256 inline qreal length()
const {
return m_length; }
258 inline bool isValid()
const {
return m_start >= 0.;}
260 inline bool equals(
const Span& other )
const {
261 return m_start == other.m_start && m_length == other.m_length;
263 inline Span expandedTo(
const Span& other)
const {
264 const qreal new_start = qMin(
start(),other.start());
265 return Span( new_start, (end()<other.end())?other.end()-new_start:end()-new_start);
269 inline bool operator==(
const Span& s1,
const Span& s2) {
return s1.equals( s2 ); }
270 inline bool operator!=(
const Span& s1,
const Span& s2) {
return !s1.equals( s2 ); }
279 DateTimeSpan(
const DateTimeSpan& other );
282 DateTimeSpan& operator=(
const DateTimeSpan& other );
287 inline void setEnd(
const QDateTime& end ) { m_end=
end; }
292 bool equals(
const DateTimeSpan& other )
const;
295 inline bool operator==(
const DateTimeSpan& s1,
const DateTimeSpan& s2) {
return s1.equals( s2 ); }
296 inline bool operator!=(
const DateTimeSpan& s1,
const DateTimeSpan& s2) {
return !s1.equals( s2 ); }
299Q_DECLARE_METATYPE(KGantt::ItemType)
301#ifndef QT_NO_DEBUG_STREAM
310Q_DECLARE_TYPEINFO(KGantt::DateTimeSpan, Q_MOVABLE_TYPE);
A class representing a start point and a length.
Q_SCRIPTABLE Q_NOREPLY void start()
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
@ ItemTypeRole
The item type.
@ KGanttRoleBase
The base value used for the KGantt role enum values. The actual roles have values base+1,...
@ StartTimeRole
Start time (or other start value) for a gantt item.
@ TaskCompletionRole
Task completion percentage used by Task items. Should be an integer og a qreal between 0 and 100.
@ LegendRole
The Legend text.
@ EndTimeRole
End time (or other end value) for a gantt item.
@ TextPositionRole
The position of the text label on the item. The type of this value is KGantt::StyleOptionGanttItem::P...
KIOCORE_EXPORT bool operator!=(const UDSEntry &entry, const UDSEntry &other)
bool isValid(QStringView ifopt)
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)