Commit 62ece6ad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15

parent 96cdcef1
......@@ -267,8 +267,13 @@ VisualFreeBusyWidget::VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *m
// Initially, show 15 days back and forth
// set start to even hours, i.e. to 12:AM 0 Min 0 Sec
QDateTime horizonStart
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QDateTime horizonStart
= QDateTime(QDateTime::currentDateTime().addDays(-15).date());
#else
const QDateTime horizonStart
= QDateTime(QDateTime::currentDateTime().addDays(-15).date().startOfDay());
#endif
mGanttGrid->setStartDateTime(horizonStart);
connect(mLeftView, &QTreeView::customContextMenuRequested, this,
......@@ -317,7 +322,13 @@ void VisualFreeBusyWidget::slotUpdateIncidenceStartEnd(const QDateTime &dtFrom,
{
mDtStart = dtFrom;
mDtEnd = dtTo;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QDateTime horizonStart = QDateTime(dtFrom.addDays(-15).date());
#else
QDateTime horizonStart = QDateTime(dtFrom.addDays(-15).date().startOfDay());
#endif
KGantt::DateTimeGrid *grid = static_cast<KGantt::DateTimeGrid *>(mGanttGraphicsView->grid());
grid->setStartDateTime(horizonStart);
slotCenterOnStart();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment