Eventviews

monthview.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Bruno Virlet <bruno.virlet@gmail.com>
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4 SPDX-FileContributor: Bertjan Broeksema <broeksema@kde.org>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8
9#include "monthview.h"
10#include "monthgraphicsitems.h"
11#include "monthitem.h"
12#include "monthscene.h"
13#include "prefs.h"
14
15#include <Akonadi/CalendarBase>
16#include <CalendarSupport/CollectionSelection>
17#include <CalendarSupport/KCalPrefs>
18#include <CalendarSupport/Utils>
19
20#include "calendarview_debug.h"
21#include <KCalendarCore/OccurrenceIterator>
22#include <KCheckableProxyModel>
23#include <KLocalizedString>
24#include <QIcon>
25
26#include <QHBoxLayout>
27#include <QTimer>
28#include <QToolButton>
29#include <QWheelEvent>
30
31#include <ranges>
32
33using namespace EventViews;
34
35namespace EventViews
36{
37class MonthViewPrivate : public KCalendarCore::Calendar::CalendarObserver
38{
39 MonthView *const q;
40
41public: /// Methods
42 explicit MonthViewPrivate(MonthView *qq);
43
44 MonthItem *loadCalendarIncidences(const Akonadi::CollectionCalendar::Ptr &calendar, const QDateTime &startDt, const QDateTime &endDt);
45
46 void addIncidence(const Akonadi::Item &incidence);
47 void moveStartDate(int weeks, int months);
48 // void setUpModels();
49 void triggerDelayedReload(EventView::Change reason);
50
51public: /// Members
52 QTimer reloadTimer;
53 MonthScene *scene = nullptr;
54 QDate selectedItemDate;
55 Akonadi::Item::Id selectedItemId;
56 MonthGraphicsView *view = nullptr;
57 QToolButton *fullView = nullptr;
58
59 // List of uids for QDate
61
62protected:
63 /* reimplemented from KCalendarCore::Calendar::CalendarObserver */
64 void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &incidence) override;
65 void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &incidence) override;
66 void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar) override;
67
68private:
69 // quiet --overloaded-virtual warning
71};
72}
73
74MonthViewPrivate::MonthViewPrivate(MonthView *qq)
75 : q(qq)
76 , scene(new MonthScene(qq))
77 , selectedItemId(-1)
78 , view(new MonthGraphicsView(qq))
79 , fullView(nullptr)
80{
81 reloadTimer.setSingleShot(true);
82 view->setScene(scene);
83}
84
85MonthItem *MonthViewPrivate::loadCalendarIncidences(const Akonadi::CollectionCalendar::Ptr &calendar, const QDateTime &startDt, const QDateTime &endDt)
86{
87 MonthItem *itemToReselect = nullptr;
88
89 const bool colorMonthBusyDays = q->preferences()->colorMonthBusyDays();
90
91 KCalendarCore::OccurrenceIterator occurIter(*calendar, startDt, endDt);
92 while (occurIter.hasNext()) {
93 occurIter.next();
94
95 // Remove the two checks when filtering is done through a proxyModel, when using calendar search
96 if (!q->preferences()->showTodosMonthView() && occurIter.incidence()->type() == KCalendarCore::Incidence::TypeTodo) {
97 continue;
98 }
99 if (!q->preferences()->showJournalsMonthView() && occurIter.incidence()->type() == KCalendarCore::Incidence::TypeJournal) {
100 continue;
101 }
102
103 const bool busyDay = colorMonthBusyDays && q->makesWholeDayBusy(occurIter.incidence());
104 if (busyDay) {
105 QStringList &list = mBusyDays[occurIter.occurrenceStartDate().date()];
106 list.append(occurIter.incidence()->uid());
107 }
108
109 const Akonadi::Item item = calendar->item(occurIter.incidence());
110 if (!item.isValid()) {
111 continue;
112 }
113 Q_ASSERT(item.isValid());
114 Q_ASSERT(item.hasPayload());
115 MonthItem *manager = new IncidenceMonthItem(scene, calendar, item, occurIter.incidence(), occurIter.occurrenceStartDate().toLocalTime().date());
116 scene->mManagerList.push_back(manager);
117 if (selectedItemId == item.id() && manager->realStartDate() == selectedItemDate) {
118 // only select it outside the loop because we are still creating items
119 itemToReselect = manager;
120 }
121 }
122
123 return itemToReselect;
124}
125
126void MonthViewPrivate::addIncidence(const Akonadi::Item &incidence)
127{
128 Q_UNUSED(incidence)
129 // TODO: add some more intelligence here...
130 q->setChanges(q->changes() | EventView::IncidencesAdded);
131 reloadTimer.start(50);
132}
133
134void MonthViewPrivate::moveStartDate(int weeks, int months)
135{
136 auto start = q->startDateTime();
137 auto end = q->endDateTime();
138 start = start.addDays(weeks * 7);
139 end = end.addDays(weeks * 7);
140 start = start.addMonths(months);
141 end = end.addMonths(months);
142
144 QDate d = start.date();
145 const QDate e = end.date();
146 dateList.reserve(d.daysTo(e) + 1);
147 while (d <= e) {
148 dateList.append(d);
149 d = d.addDays(1);
150 }
151
152 /**
153 * If we call q->setDateRange( start, end ); directly,
154 * it will change the selected dates in month view,
155 * but the application won't know about it.
156 * The correct way is to Q_EMIT datesSelected()
157 * #250256
158 * */
159 Q_EMIT q->datesSelected(dateList);
160}
161
162void MonthViewPrivate::triggerDelayedReload(EventView::Change reason)
163{
164 q->setChanges(q->changes() | reason);
165 if (!reloadTimer.isActive()) {
166 reloadTimer.start(50);
167 }
168}
169
170void MonthViewPrivate::calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &)
171{
172 triggerDelayedReload(MonthView::IncidencesAdded);
173}
174
175void MonthViewPrivate::calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &)
176{
177 triggerDelayedReload(MonthView::IncidencesEdited);
178}
179
180void MonthViewPrivate::calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Calendar *calendar)
181{
182 Q_UNUSED(calendar)
183 Q_ASSERT(!incidence->uid().isEmpty());
184 scene->removeIncidence(incidence->uid());
185}
186
187/// MonthView
188
189MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
190 : EventView(parent)
191 , d(new MonthViewPrivate(this))
192{
193 auto topLayout = new QHBoxLayout(this);
194 topLayout->addWidget(d->view);
195 topLayout->setContentsMargins({});
196
197 if (visibility == Visible) {
198 auto rightLayout = new QVBoxLayout();
199 rightLayout->setSpacing(0);
200 rightLayout->setContentsMargins({});
201
202 // push buttons to the bottom
203 rightLayout->addStretch(1);
204
205 d->fullView = new QToolButton(this);
206 d->fullView->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
207 d->fullView->setAutoRaise(true);
208 d->fullView->setCheckable(true);
209 d->fullView->setChecked(preferences()->fullViewMonth());
210 d->fullView->isChecked() ? d->fullView->setToolTip(i18nc("@info:tooltip", "Display calendar in a normal size"))
211 : d->fullView->setToolTip(i18nc("@info:tooltip", "Display calendar in a full window"));
212 d->fullView->setWhatsThis(i18nc("@info:whatsthis",
213 "Click this button and the month view will be enlarged to fill the "
214 "maximum available window space / or shrunk back to its normal size."));
215 connect(d->fullView, &QAbstractButton::clicked, this, &MonthView::changeFullView);
216
217 auto minusMonth = new QToolButton(this);
218 minusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up-double")));
219 minusMonth->setAutoRaise(true);
220 minusMonth->setToolTip(i18nc("@info:tooltip", "Go back one month"));
221 minusMonth->setWhatsThis(i18nc("@info:whatsthis", "Click this button and the view will be scrolled back in time by 1 month."));
223
224 auto minusWeek = new QToolButton(this);
225 minusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up")));
226 minusWeek->setAutoRaise(true);
227 minusWeek->setToolTip(i18nc("@info:tooltip", "Go back one week"));
228 minusWeek->setWhatsThis(i18nc("@info:whatsthis", "Click this button and the view will be scrolled back in time by 1 week."));
230
231 auto plusWeek = new QToolButton(this);
232 plusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
233 plusWeek->setAutoRaise(true);
234 plusWeek->setToolTip(i18nc("@info:tooltip", "Go forward one week"));
235 plusWeek->setWhatsThis(i18nc("@info:whatsthis", "Click this button and the view will be scrolled forward in time by 1 week."));
237
238 auto plusMonth = new QToolButton(this);
239 plusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down-double")));
240 plusMonth->setAutoRaise(true);
241 plusMonth->setToolTip(i18nc("@info:tooltip", "Go forward one month"));
242 plusMonth->setWhatsThis(i18nc("@info:whatsthis", "Click this button and the view will be scrolled forward in time by 1 month."));
244
245 rightLayout->addWidget(d->fullView);
246 rightLayout->addWidget(minusMonth);
247 rightLayout->addWidget(minusWeek);
248 rightLayout->addWidget(plusWeek);
249 rightLayout->addWidget(plusMonth);
250
251 topLayout->addLayout(rightLayout);
252 } else {
253 d->view->setFrameStyle(QFrame::NoFrame);
254 }
255
256 connect(d->scene, &MonthScene::showIncidencePopupSignal, this, &MonthView::showIncidencePopupSignal);
257
258 connect(d->scene, &MonthScene::incidenceSelected, this, &EventView::incidenceSelected);
259
260 connect(d->scene, &MonthScene::newEventSignal, this, qOverload<>(&EventView::newEventSignal));
261
262 connect(d->scene, &MonthScene::showNewEventPopupSignal, this, &MonthView::showNewEventPopupSignal);
263
264 connect(&d->reloadTimer, &QTimer::timeout, this, &MonthView::reloadIncidences);
265 updateConfig();
266
267 // d->setUpModels();
268 d->reloadTimer.start(50);
269}
270
271MonthView::~MonthView()
272{
273 for (auto &calendar : calendars()) {
274 calendar->unregisterObserver(d.get());
275 }
276}
277
278void MonthView::addCalendar(const Akonadi::CollectionCalendar::Ptr &calendar)
279{
280 EventView::addCalendar(calendar);
281 calendar->registerObserver(d.get());
282 setChanges(changes() | ResourcesChanged);
283 d->reloadTimer.start(50);
284}
285
286void MonthView::removeCalendar(const Akonadi::CollectionCalendar::Ptr &calendar)
287{
288 EventView::removeCalendar(calendar);
289 calendar->unregisterObserver(d.get());
290 setChanges(changes() | ResourcesChanged);
291 d->reloadTimer.start(50);
292}
293
294void MonthView::updateConfig()
295{
296 d->scene->update();
297 setChanges(changes() | ConfigChanged);
298 d->reloadTimer.start(50);
299}
300
302{
303 return actualStartDateTime().date().daysTo(actualEndDateTime().date());
304}
305
307{
309 if (d->scene->selectedItem()) {
310 auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
311 if (tmp) {
312 QDate selectedItemDate = tmp->realStartDate();
313 if (selectedItemDate.isValid()) {
314 list << selectedItemDate;
315 }
316 }
317 } else if (d->scene->selectedCell()) {
318 list << d->scene->selectedCell()->date();
319 }
320
321 return list;
322}
323
325{
326 if (d->scene->selectedCell()) {
327 return QDateTime(d->scene->selectedCell()->date().startOfDay());
328 } else {
329 return {};
330 }
331}
332
334{
335 // Only one cell can be selected (for now)
336 return selectionStart();
337}
338
339void MonthView::setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth)
340{
341 EventView::setDateRange(start, end, preferredMonth);
342 setChanges(changes() | DatesChanged);
343 d->reloadTimer.start(50);
344}
345
346bool MonthView::eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) const
347{
348 // If we have valid start and end dates only adjust them to be all day
349 // but otherwise preserve them.
350 if (startDt.isValid() && endDt.isValid()) {
351 startDt.setTime(QTime());
352 endDt.setTime(QTime());
353 allDay = true;
354 return true;
355 }
356
357 if (d->scene->selectedCell()) {
358 startDt.setDate(d->scene->selectedCell()->date());
359 endDt.setDate(d->scene->selectedCell()->date());
360 allDay = true;
361 return true;
362 }
363
364 return false;
365}
366
367void MonthView::showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
368{
369 Q_UNUSED(incidenceList)
370 Q_UNUSED(date)
371}
372
373void MonthView::changeIncidenceDisplay(const Akonadi::Item &incidence, int action)
374{
375 Q_UNUSED(incidence)
376 Q_UNUSED(action)
377
378 // TODO: add some more intelligence here...
379
380 // don't call reloadIncidences() directly. It would delete all
381 // MonthItems, but this changeIncidenceDisplay()-method was probably
382 // called by one of the MonthItem objects. So only schedule a reload
383 // as event
384 setChanges(changes() | IncidencesEdited);
385 d->reloadTimer.start(50);
386}
387
388void MonthView::updateView()
389{
390 d->view->update();
391}
392
393#ifndef QT_NO_WHEELEVENT
394void MonthView::wheelEvent(QWheelEvent *event)
395{
396 // invert direction to get scroll-like behaviour
397 if (event->angleDelta().y() > 0) {
398 d->moveStartDate(-1, 0);
399 } else if (event->angleDelta().y() < 0) {
400 d->moveStartDate(1, 0);
401 }
402
403 // call accept in every case, we do not want anybody else to react
404 event->accept();
405}
406
407#endif
408
409void MonthView::keyPressEvent(QKeyEvent *event)
410{
411 if (event->key() == Qt::Key_PageUp) {
412 d->moveStartDate(0, -1);
413 event->accept();
414 } else if (event->key() == Qt::Key_PageDown) {
415 d->moveStartDate(0, 1);
416 event->accept();
417 } else if (processKeyEvent(event)) {
418 event->accept();
419 } else {
420 event->ignore();
421 }
422}
423
424void MonthView::keyReleaseEvent(QKeyEvent *event)
425{
426 if (processKeyEvent(event)) {
427 event->accept();
428 } else {
429 event->ignore();
430 }
431}
432
433void MonthView::changeFullView()
434{
435 bool fullView = d->fullView->isChecked();
436
437 if (fullView) {
438 d->fullView->setIcon(QIcon::fromTheme(QStringLiteral("view-restore")));
439 d->fullView->setToolTip(i18nc("@info:tooltip", "Display calendar in a normal size"));
440 } else {
441 d->fullView->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
442 d->fullView->setToolTip(i18nc("@info:tooltip", "Display calendar in a full window"));
443 }
444 preferences()->setFullViewMonth(fullView);
445 preferences()->writeConfig();
446
447 Q_EMIT fullViewChanged(fullView);
448}
449
451{
452 d->moveStartDate(0, -1);
453}
454
456{
457 d->moveStartDate(-1, 0);
458}
459
461{
462 d->moveStartDate(1, 0);
463}
464
466{
467 d->moveStartDate(0, 1);
468}
469
470void MonthView::showDates(const QDate &start, const QDate &end, const QDate &preferedMonth)
471{
472 Q_UNUSED(start)
473 Q_UNUSED(end)
474 Q_UNUSED(preferedMonth)
475 d->triggerDelayedReload(DatesChanged);
476}
477
478QPair<QDateTime, QDateTime> MonthView::actualDateRange(const QDateTime &start, const QDateTime &, const QDate &preferredMonth) const
479{
480 QDateTime dayOne = preferredMonth.isValid() ? QDateTime(preferredMonth.startOfDay()) : start;
481
482 dayOne.setDate(QDate(dayOne.date().year(), dayOne.date().month(), 1));
483 const int weekdayCol = (dayOne.date().dayOfWeek() + 7 - preferences()->firstDayOfWeek()) % 7;
484 QDateTime actualStart = dayOne.addDays(-weekdayCol);
485 actualStart.setTime(QTime(0, 0, 0, 0));
486 QDateTime actualEnd = actualStart.addDays(6 * 7 - 1);
487 actualEnd.setTime(QTime(23, 59, 59, 99));
488 return qMakePair(actualStart, actualEnd);
489}
490
492{
493 Akonadi::Item::List selected;
494 if (d->scene->selectedItem()) {
495 auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
496 if (tmp) {
497 Akonadi::Item incidenceSelected = tmp->akonadiItem();
498 if (incidenceSelected.isValid()) {
499 selected.append(incidenceSelected);
500 }
501 }
502 }
503 return selected;
504}
505
506KHolidays::Holiday::List MonthView::holidays(QDate startDate, QDate endDate)
507{
509 auto const regions = CalendarSupport::KCalPrefs::instance()->mHolidays;
510 for (auto const &r : regions) {
511 KHolidays::HolidayRegion region(r);
512 if (region.isValid()) {
513 holidays += region.rawHolidaysWithAstroSeasons(startDate, endDate);
514 }
515 }
516 return holidays;
517}
518
519void MonthView::reloadIncidences()
520{
521 if (changes() == NothingChanged) {
522 return;
523 }
524 // keep selection if it exists
525 Akonadi::Item incidenceSelected;
526
527 MonthItem *itemToReselect = nullptr;
528
529 if (auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem())) {
530 d->selectedItemId = tmp->akonadiItem().id();
531 d->selectedItemDate = tmp->realStartDate();
532 if (!d->selectedItemDate.isValid()) {
533 return;
534 }
535 }
536
537 d->scene->resetAll();
538 d->mBusyDays.clear();
539 // build monthcells hash
540 int i = 0;
541 for (QDate date = actualStartDateTime().date(); date <= actualEndDateTime().date(); date = date.addDays(1)) {
542 d->scene->mMonthCellMap[date] = new MonthCell(i, date, d->scene);
543 i++;
544 }
545
546 // build global event list
547 for (const auto &calendar : calendars()) {
548 auto *newItemToReselect = d->loadCalendarIncidences(calendar, actualStartDateTime(), actualEndDateTime());
549 if (itemToReselect == nullptr) {
550 itemToReselect = newItemToReselect;
551 }
552 }
553
554 if (itemToReselect) {
555 d->scene->selectItem(itemToReselect);
556 }
557
558 // add holidays
559 for (auto const &h : holidays(actualStartDateTime().date(), actualEndDateTime().date())) {
560 if (h.dayType() == KHolidays::Holiday::NonWorkday) {
561 MonthItem *holidayItem = new HolidayMonthItem(d->scene, h.observedStartDate(), h.observedEndDate(), h.name());
562 d->scene->mManagerList << holidayItem;
563 }
564 }
565
566 // sort it
567 std::sort(d->scene->mManagerList.begin(), d->scene->mManagerList.end(), MonthItem::greaterThan);
568
569 // build each month's cell event list
570 for (MonthItem *manager : std::as_const(d->scene->mManagerList)) {
571 for (QDate date = manager->startDate(); date <= manager->endDate(); date = date.addDays(1)) {
572 MonthCell *cell = d->scene->mMonthCellMap.value(date);
573 if (cell) {
574 cell->mMonthItemList << manager;
575 }
576 }
577 }
578
579 for (MonthItem *manager : std::as_const(d->scene->mManagerList)) {
580 manager->updateMonthGraphicsItems();
581 manager->updatePosition();
582 }
583
584 for (MonthItem *manager : std::as_const(d->scene->mManagerList)) {
585 manager->updateGeometry();
586 }
587
588 d->scene->setInitialized(true);
589 d->view->update();
590 d->scene->update();
591}
592
594{
595 qCDebug(CALENDARVIEW_LOG);
596 d->triggerDelayedReload(ResourcesChanged);
597}
598
600{
601 return actualStartDateTime().date().addDays(actualStartDateTime().date().daysTo(actualEndDateTime().date()) / 2);
602}
603
604int MonthView::currentMonth() const
605{
606 return averageDate().month();
607}
608
609bool MonthView::usesFullWindow()
610{
611 return preferences()->fullViewMonth();
612}
613
614bool MonthView::isBusyDay(QDate day) const
615{
616 return !d->mBusyDays[day].isEmpty();
617}
618
619#include "moc_monthview.cpp"
Id id() const
bool isValid() const
bool hasPayload() const
EventView is the abstract base class from which all other calendar views for event data are derived.
Definition eventview.h:69
bool processKeyEvent(QKeyEvent *)
Handles key events, opens the new event dialog when enter is pressed, activates type ahead.
virtual void setChanges(Changes changes)
Notifies the view that there are pending changes so a redraw is needed.
void newEventSignal()
instructs the receiver to create a new event in given collection.
void datesSelected(const KCalendarCore::DateList &datelist)
when the view changes the dates that are selected in one way or another, this signal is emitted.
Changes changes() const
Returns if there are pending changes and a redraw is needed.
virtual void setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth=QDate())
Keeps information about a month cell.
QList< MonthItem * > mMonthItemList
This is used to get the height of the minimum height (vertical position) in the month cells.
Renders a MonthScene.
Definition monthscene.h:316
A month item manages different MonthGraphicsItems.
Definition monthitem.h:27
static bool greaterThan(const MonthItem *e1, const MonthItem *e2)
Compares two items to decide which to place in the view first.
void updateGeometry()
Updates geometry of all MonthGraphicsItems.
void updatePosition()
Find the lowest possible position for this item.
QDate startDate() const
The start date of the incidence, generally realStartDate.
void updateMonthGraphicsItems()
Update the monthgraphicsitems.
Definition monthitem.cpp:54
virtual QDate realStartDate() const =0
This is the real start date, usually the start date of the incidence.
QDateTime selectionStart() const override
Returns the start of the selection, or an invalid QDateTime if there is no selection or the view does...
void moveBackWeek()
Shift the view one month back.
void moveFwdMonth()
Shift the view one week forward.
void setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth=QDate()) override
void calendarReset() override
Shift the view one month forward.
MonthView(NavButtonsVisibility visibility=Visible, QWidget *parent=nullptr)
MonthView.
QDate averageDate() const
Returns the average date in the view.
Akonadi::Item::List selectedIncidences() const override
void moveFwdWeek()
Shift the view one week back.
bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) const override
Sets the default start/end date/time for new events.
void showDates(const QDate &start, const QDate &end, const QDate &preferedMonth=QDate()) override
QPair< QDateTime, QDateTime > actualDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth=QDate()) const override
from the requested date range (passed via setDateRange()), calculates the adjusted date range actuall...
QDateTime selectionEnd() const override
Returns the end of the selection, or an invalid QDateTime if there is no selection or the view doesn'...
int currentDateCount() const override
Returns the number of currently shown dates.
void moveBackMonth()
Display in full window mode.
KCalendarCore::DateList selectedIncidenceDates() const override
Returns dates of the currently selected events.
virtual void calendarIncidenceDeleted(const Incidence::Ptr &incidence, const Calendar *calendar)
void unregisterObserver(CalendarObserver *observer)
Q_SCRIPTABLE Q_NOREPLY void start()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
AKONADI_CALENDAR_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item)
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
KIOCORE_EXPORT QStringList list(const QString &fileClass)
const QList< QKeySequence > & end()
void clicked(bool checked)
QDate addDays(qint64 ndays) const const
qint64 daysTo(QDate d) const const
bool isValid(int year, int month, int day)
int month() const const
QDateTime startOfDay() const const
int year() const const
QDateTime addDays(qint64 ndays) const const
QDate date() const const
bool isValid() const const
void setDate(QDate date)
void setTime(QTime time)
QIcon fromTheme(const QString &name)
void append(QList< T > &&value)
void reserve(qsizetype size)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T qobject_cast(QObject *object)
Key_PageUp
bool isActive() const const
void start()
void timeout()
virtual bool event(QEvent *event) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.