23 #ifndef KDGANTTDATETIMEGRID_H 24 #define KDGANTTDATETIMEGRID_H 33 class DateTimeScaleFormatter;
52 QDateTime startDateTime()
const;
53 void setStartDateTime(
const QDateTime& dt );
55 qreal dayWidth()
const;
56 void setDayWidth( qreal );
58 qreal mapFromDateTime(
const QDateTime& dt)
const;
59 QDateTime mapToDateTime( qreal x )
const;
61 void setWeekStart( Qt::DayOfWeek );
62 Qt::DayOfWeek weekStart()
const;
64 void setFreeDays(
const QSet<Qt::DayOfWeek>& fd );
65 QSet<Qt::DayOfWeek> freeDays()
const;
67 void setFreeDaysBrush(
const QBrush brush);
68 QBrush freeDaysBrush()
const;
70 void setScale(
Scale s );
78 bool rowSeparators()
const;
79 void setRowSeparators(
bool enable );
81 void setNoInformationBrush(
const QBrush& brush );
82 QBrush noInformationBrush()
const;
84 Span mapToChart(
const QModelIndex& idx )
const override;
85 bool mapFromChart(
const Span& span,
const QModelIndex& idx,
87 qreal mapToChart(
const QVariant& value )
const override;
88 QVariant mapFromChart( qreal x )
const override;
89 void paintGrid( QPainter* painter,
90 const QRectF& sceneRect,
const QRectF& exposedRect,
93 void paintHeader( QPainter* painter,
94 const QRectF& headerRect,
const QRectF& exposedRect,
95 qreal offset,
QWidget* widget=0 )
override;
98 virtual void paintHourScaleHeader( QPainter* painter,
99 const QRectF& headerRect,
const QRectF& exposedRect,
100 qreal offset,
QWidget* widget=0 );
101 virtual void paintDayScaleHeader( QPainter* painter,
102 const QRectF& headerRect,
const QRectF& exposedRect,
103 qreal offset,
QWidget* widget=0 );
104 virtual void paintWeekScaleHeader( QPainter* painter,
105 const QRectF& headerRect,
const QRectF& exposedRect,
106 qreal offset,
QWidget* widget=0 );
107 virtual void paintMonthScaleHeader( QPainter* painter,
108 const QRectF& headerRect,
const QRectF& exposedRect,
109 qreal offset,
QWidget* widget=0 );
111 virtual void paintUserDefinedHeader( QPainter* painter,
112 const QRectF& headerRect,
const QRectF& exposedRect,
116 virtual void drawDayBackground(QPainter* painter,
const QRectF& rect,
const QDate& date);
117 virtual void drawDayForeground(QPainter* painter,
const QRectF& rect,
const QDate& date);
119 QRectF computeRect(
const QDateTime& from,
const QDateTime& to,
const QRectF& rect)
const;
122 void drawBackground(QPainter* paint,
const QRectF& rect)
override;
123 void drawForeground(QPainter* paint,
const QRectF& rect)
override;
141 Qt::Alignment alignment = Qt::AlignCenter );
143 const QString& templ, Qt::Alignment alignment = Qt::AlignCenter );
149 QString format()
const;
151 Qt::Alignment alignment()
const;
153 virtual QDateTime nextRangeBegin(
const QDateTime& datetime )
const;
154 virtual QDateTime currentRangeBegin(
const QDateTime& datetime )
const;
156 QString format(
const QDateTime& datetime )
const;
157 virtual QString text(
const QDateTime& datetime )
const;
163 #ifndef QT_NO_DEBUG_STREAM
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
QDebug KDGANTT_EXPORT operator<<(QDebug dbg, KDGantt::DateTimeScaleFormatter::Range)
Abstract baseclass for grids. A grid is used to convert between QModelIndex'es and gantt chart values...
A class representing a start point and a length.
#define KDGANTT_DECLARE_PRIVATE_DERIVED(X)
Abstract baseclass for row controllers. A row controller is used by the GraphicsView to nagivate the ...