Eventviews

eventview.cpp
1/*
2 SPDX-FileCopyrightText: 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
3 SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
4 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
5 SPDX-FileContributor: Kevin Krammer <krake@kdab.com>
6 SPDX-FileContributor: Sergio Martins <sergio@kdab.com>
7
8 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
9*/
10
11#include "eventview_p.h"
12using namespace Qt::Literals::StringLiterals;
13
14#include "prefs.h"
15
16#include <CalendarSupport/CollectionSelection>
17#include <CalendarSupport/KCalPrefs>
18
19#include <Akonadi/CalendarUtils>
20#include <Akonadi/ETMViewStateSaver>
21#include <Akonadi/EntityDisplayAttribute>
22#include <Akonadi/EntityTreeModel>
23
24#include <KCalendarCore/CalFilter>
25
26#include <KCalUtils/RecurrenceActions>
27
28#include <KHolidays/HolidayRegion>
29
30#include "calendarview_debug.h"
31#include <KCheckableProxyModel>
32#include <KGuiItem>
33#include <KLocalizedString>
34#include <KRandom>
35#include <KRearrangeColumnsProxyModel>
36#include <KViewStateMaintainer>
37
38#include <QApplication>
39#include <QKeyEvent>
40#include <QSortFilterProxyModel>
41
42using namespace KCalendarCore;
43using namespace EventViews;
44using namespace Akonadi;
45
46CalendarSupport::CollectionSelection *EventViewPrivate::sGlobalCollectionSelection = nullptr;
47
48/* static */
49void EventView::setGlobalCollectionSelection(CalendarSupport::CollectionSelection *s)
50{
51 EventViewPrivate::sGlobalCollectionSelection = s;
52}
53
55 : QWidget(parent)
56 , d_ptr(new EventViewPrivate(this))
57{
58 QByteArray cname = metaObject()->className();
59 cname.replace(':', '_');
60 d_ptr->identifier = cname + '_' + KRandom::randomString(8).toLatin1();
61
62 // AKONADI_PORT review: the FocusLineEdit in the editor emits focusReceivedSignal(),
63 // which triggered finishTypeAhead. But the global focus widget in QApplication is
64 // changed later, thus subsequent keyevents still went to this view, triggering another
65 // editor, for each keypress.
66 // Thus, listen to the global focusChanged() signal (seen in Qt 4.6-stable-patched 20091112 -Frank)
68
69 d_ptr->setUpModels();
70}
71
72EventView::~EventView() = default;
73
75{
76 qCDebug(CALENDARVIEW_LOG);
78 if (!incidence) {
79 return;
80 }
81
82 qCDebug(CALENDARVIEW_LOG) << " type:" << int(incidence->type());
83
84 if (incidence->isReadOnly()) {
86 } else {
88 }
89}
90
92{
94 d->mHolidayRegions.clear();
95 for (const QString &regionStr : regions) {
96 auto region = std::make_unique<KHolidays::HolidayRegion>(regionStr);
97 if (region->isValid()) {
98 d->mHolidayRegions.push_back(std::move(region));
99 }
100 }
101}
102
103int EventView::showMoveRecurDialog(const Incidence::Ptr &inc, QDate date)
104{
105 QDateTime dateTime(date, {}, QTimeZone::LocalTime);
106
107 int availableOccurrences = KCalUtils::RecurrenceActions::availableOccurrences(inc, dateTime);
108
109 const QString caption = i18nc("@title:window", "Changing Recurring Item");
110 KGuiItem itemFuture(i18n("Also &Future Items"));
111 KGuiItem itemSelected(i18n("Only &This Item"));
112 KGuiItem itemAll(i18n("&All Occurrences"));
113
114 switch (availableOccurrences) {
117
120
122 Q_ASSERT(availableOccurrences & KCalUtils::RecurrenceActions::SelectedOccurrence);
123
124 // if there are all kinds of ooccurrences (i.e. past present and future) the user might
125 // want the option only apply to current and future occurrences, leaving the past ones
126 // provide a third choice for that ("Also future")
127 if (availableOccurrences == KCalUtils::RecurrenceActions::AllOccurrences) {
128 const QString message = i18n(
129 "The item you are trying to change is a recurring item. "
130 "Should the changes be applied only to this single occurrence, "
131 "also to future items, or to all items in the recurrence?");
132 return KCalUtils::RecurrenceActions::questionSelectedFutureAllCancel(message, caption, itemSelected, itemFuture, itemAll, this);
133 }
134 [[fallthrough]];
135
136 default:
137 Q_ASSERT(availableOccurrences & KCalUtils::RecurrenceActions::SelectedOccurrence);
138 // selected occurrence and either past or future occurrences
139 const QString message = i18n(
140 "The item you are trying to change is a recurring item. "
141 "Should the changes be applied only to this single occurrence "
142 "or to all items in the recurrence?");
143 return KCalUtils::RecurrenceActions::questionSelectedAllCancel(message, caption, itemSelected, itemAll, this);
144 break;
145 }
146
148}
149
150void EventView::addCalendar(const Akonadi::CollectionCalendar::Ptr &calendar)
151{
152 Q_D(EventView);
153 d->mCalendars.push_back(calendar);
154}
155
156void EventView::removeCalendar(const Akonadi::CollectionCalendar::Ptr &calendar)
157{
158 Q_D(EventView);
159 d->mCalendars.removeOne(calendar);
160}
161
162void EventView::setModel(QAbstractItemModel *model)
163{
164 Q_D(EventView);
165 if (d->model != model) {
166 d->model = model;
167 if (d->model) {
168 if (d->collectionSelectionModel) {
169 d->collectionSelectionModel->setSourceModel(d->model);
170 }
171
172 d->setEtm(d->model);
173 d->setUpModels();
174
175 connect(d->model, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
176 Q_D(EventView);
177
178 for (int i = topLeft.row(); i <= bottomRight.row(); ++i) {
179 const auto index = topLeft.siblingAtRow(i);
180 const auto col = d->model->data(index, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
181 if (col.isValid()) {
182 // TODO: we have no way of knowing what has actually changed in the model :(
183 onCollectionChanged(col, {"AccessRights"});
184 }
185 }
186 });
187 }
188 }
189}
190
191QAbstractItemModel *EventView::model() const
192{
193 Q_D(const EventView);
194 return d->model;
195}
196
197Akonadi::EntityTreeModel *EventView::entityTreeModel() const
198{
199 Q_D(const EventView);
200 return d->etm;
201}
202
203void EventView::setPreferences(const PrefsPtr &preferences)
204{
205 Q_D(EventView);
206 if (d->mPrefs != preferences) {
207 if (preferences) {
208 d->mPrefs = preferences;
209 } else {
210 d->mPrefs = PrefsPtr(new Prefs());
211 }
212 updateConfig();
213 }
214}
215
216void EventView::setKCalPreferences(const KCalPrefsPtr &preferences)
217{
218 Q_D(EventView);
219 if (d->mKCalPrefs != preferences) {
220 if (preferences) {
221 d->mKCalPrefs = preferences;
222 } else {
223 d->mKCalPrefs = KCalPrefsPtr(new CalendarSupport::KCalPrefs());
224 }
225 updateConfig();
226 }
227}
228
229PrefsPtr EventView::preferences() const
230{
231 Q_D(const EventView);
232 return d->mPrefs;
233}
234
235KCalPrefsPtr EventView::kcalPreferences() const
236{
237 Q_D(const EventView);
238 return d->mKCalPrefs;
239}
240
241void EventView::dayPassed(const QDate &)
242{
243 updateView();
244}
245
246void EventView::setIncidenceChanger(Akonadi::IncidenceChanger *changer)
247{
248 Q_D(EventView);
249 d->mChanger = changer;
250}
251
253{
254}
255
257{
258 return this;
259}
260
262{
263}
264
266{
267 return {};
268}
269
271{
272 return {};
273}
274
276{
277 Q_D(const EventView);
278 return d->mDateRangeSelectionEnabled;
279}
280
282{
283 Q_D(EventView);
284 d->mDateRangeSelectionEnabled = enable;
285}
286
288{
289 return false;
290}
291
292bool EventView::hasConfigurationDialog() const
293{
294 return false;
295}
296
297void EventView::setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth)
298{
299 Q_D(EventView);
300
301 d->startDateTime = start;
302 d->endDateTime = end;
303 showDates(start.date(), end.date(), preferredMonth);
304 const QPair<QDateTime, QDateTime> adjusted = actualDateRange(start, end, preferredMonth);
305 d->actualStartDateTime = adjusted.first;
306 d->actualEndDateTime = adjusted.second;
307}
308
309QDateTime EventView::startDateTime() const
310{
311 Q_D(const EventView);
312 return d->startDateTime;
313}
314
315QDateTime EventView::endDateTime() const
316{
317 Q_D(const EventView);
318 return d->endDateTime;
319}
320
321QDateTime EventView::actualStartDateTime() const
322{
323 Q_D(const EventView);
324 return d->actualStartDateTime;
325}
326
327QDateTime EventView::actualEndDateTime() const
328{
329 Q_D(const EventView);
330 return d->actualEndDateTime;
331}
332
333void EventView::showConfigurationDialog(QWidget *)
334{
335}
336
338{
339 Q_D(EventView);
340 // If Return is pressed bring up an editor for the current selected time span.
341 if (ke->key() == Qt::Key_Return) {
342 if (ke->type() == QEvent::KeyPress) {
343 d->mReturnPressed = true;
344 } else if (ke->type() == QEvent::KeyRelease) {
345 if (d->mReturnPressed) {
347 d->mReturnPressed = false;
348 return true;
349 } else {
350 d->mReturnPressed = false;
351 }
352 }
353 }
354
355 // Ignore all input that does not produce any output
356 if (ke->text().isEmpty() || (ke->modifiers() & Qt::ControlModifier)) {
357 return false;
358 }
359
360 if (ke->type() == QEvent::KeyPress) {
361 switch (ke->key()) {
362 case Qt::Key_Escape:
363 case Qt::Key_Return:
364 case Qt::Key_Enter:
365 case Qt::Key_Tab:
366 case Qt::Key_Backtab:
367 case Qt::Key_Left:
368 case Qt::Key_Right:
369 case Qt::Key_Up:
370 case Qt::Key_Down:
372 case Qt::Key_Delete:
373 case Qt::Key_PageUp:
374 case Qt::Key_PageDown:
375 case Qt::Key_Home:
376 case Qt::Key_End:
377 case Qt::Key_Control:
378 case Qt::Key_Meta:
379 case Qt::Key_Alt:
380 break;
381 default:
382 d->mTypeAheadEvents.append(new QKeyEvent(ke->type(), ke->key(), ke->modifiers(), ke->text(), ke->isAutoRepeat(), static_cast<ushort>(ke->count())));
383 if (!d->mTypeAhead) {
384 d->mTypeAhead = true;
386 }
387 return true;
388 }
389 }
390 return false;
391}
392
393void EventView::setTypeAheadReceiver(QObject *o)
394{
395 Q_D(EventView);
396 d->mTypeAheadReceiver = o;
397}
398
399void EventView::focusChanged(QWidget *, QWidget *now)
400{
401 Q_D(EventView);
402 if (d->mTypeAhead && now && now == d->mTypeAheadReceiver) {
403 d->finishTypeAhead();
404 }
405}
406
407CalendarSupport::CollectionSelection *EventView::collectionSelection() const
408{
409 Q_D(const EventView);
410 return d->customCollectionSelection ? d->customCollectionSelection.get() : globalCollectionSelection();
411}
412
413void EventView::setCustomCollectionSelectionProxyModel(KCheckableProxyModel *model)
414{
415 Q_D(EventView);
416 if (d->collectionSelectionModel == model) {
417 return;
418 }
419
420 delete d->collectionSelectionModel;
421 d->collectionSelectionModel = model;
422 d->setUpModels();
423}
424
425KCheckableProxyModel *EventView::customCollectionSelectionProxyModel() const
426{
427 Q_D(const EventView);
428 return d->collectionSelectionModel;
429}
430
431KCheckableProxyModel *EventView::takeCustomCollectionSelectionProxyModel()
432{
433 Q_D(EventView);
434 KCheckableProxyModel *m = d->collectionSelectionModel;
435 d->collectionSelectionModel = nullptr;
436 d->setUpModels();
437 return m;
438}
439
440CalendarSupport::CollectionSelection *EventView::customCollectionSelection() const
441{
442 Q_D(const EventView);
443 return d->customCollectionSelection.get();
444}
445
449
450bool EventView::eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) const
451{
452 Q_UNUSED(startDt)
453 Q_UNUSED(endDt)
454 Q_UNUSED(allDay)
455 return false;
456}
457
458Akonadi::IncidenceChanger *EventView::changer() const
459{
460 Q_D(const EventView);
461 return d->mChanger;
462}
463
467
471
472QPair<QDateTime, QDateTime> EventView::actualDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth) const
473{
474 Q_UNUSED(preferredMonth)
475 return qMakePair(start, end);
476}
477
478/*
479void EventView::incidencesAdded( const Akonadi::Item::List & )
480{
481}
482
483void EventView::incidencesAboutToBeRemoved( const Akonadi::Item::List & )
484{
485}
486
487void EventView::incidencesChanged( const Akonadi::Item::List & )
488{
489}
490*/
491
492void EventView::handleBackendError(const QString &errorString)
493{
494 qCCritical(CALENDARVIEW_LOG) << errorString;
495}
496
497void EventView::calendarReset()
498{
499}
500
501CalendarSupport::CollectionSelection *EventView::globalCollectionSelection()
502{
503 return EventViewPrivate::sGlobalCollectionSelection;
504}
505
506QByteArray EventView::identifier() const
507{
508 Q_D(const EventView);
509 return d->identifier;
510}
511
512void EventView::setIdentifier(const QByteArray &identifier)
513{
514 Q_D(EventView);
515 d->identifier = identifier;
516}
517
519{
520 Q_D(EventView);
521 if (d->mChanges == NothingChanged) {
523 }
524
525 d->mChanges = changes;
526}
527
529{
530 Q_D(const EventView);
531 return d->mChanges;
532}
533
535{
536 Q_D(EventView);
537 const bool useCustom = configGroup.readEntry("UseCustomCollectionSelection", false);
538 if (!d->collectionSelectionModel && !useCustom) {
539 delete d->collectionSelectionModel;
540 d->collectionSelectionModel = nullptr;
541 d->setUpModels();
542 } else if (useCustom) {
543 if (!d->collectionSelectionModel) {
544 // Sort the calendar model on calendar name
545 auto sortProxy = new QSortFilterProxyModel(this);
546 sortProxy->setSortCaseSensitivity(Qt::CaseInsensitive);
547 sortProxy->setSourceModel(d->model);
548
549 // Only show the first column.
550 auto columnFilterProxy = new KRearrangeColumnsProxyModel(this);
551 columnFilterProxy->setSourceColumns(QList<int>() << 0);
552 columnFilterProxy->setSourceModel(sortProxy);
553
554 // Make the calendar model checkable.
555 d->collectionSelectionModel = new KCheckableProxyModel(this);
556 d->collectionSelectionModel->setSourceModel(columnFilterProxy);
557
558 d->setUpModels();
559 }
560 const KConfigGroup selectionGroup = configGroup.config()->group(configGroup.name() + "_selectionSetup"_L1);
561
562 KViewStateMaintainer<ETMViewStateSaver> maintainer(selectionGroup);
563 maintainer.setSelectionModel(d->collectionSelectionModel->selectionModel());
564 maintainer.restoreState();
565 }
566
567 doRestoreConfig(configGroup);
568}
569
571{
572 Q_D(EventView);
573 configGroup.writeEntry("UseCustomCollectionSelection", d->collectionSelectionModel != nullptr);
574
575 if (d->collectionSelectionModel) {
576 KConfigGroup selectionGroup = configGroup.config()->group(configGroup.name() + "_selectionSetup"_L1);
577
578 KViewStateMaintainer<ETMViewStateSaver> maintainer(selectionGroup);
579 maintainer.setSelectionModel(d->collectionSelectionModel->selectionModel());
580 maintainer.saveState();
581 }
582
583 doSaveConfig(configGroup);
584}
585
586bool EventView::makesWholeDayBusy(const KCalendarCore::Incidence::Ptr &incidence) const
587{
588 // Must be event
589 // Must be all day
590 // Must be marked busy (TRANSP: OPAQUE)
591 // You must be attendee or organizer
592
593 if (incidence->type() != KCalendarCore::Incidence::TypeEvent || !incidence->allDay()) {
594 return false;
595 }
596
598
599 if (ev->transparency() != KCalendarCore::Event::Opaque) {
600 return false;
601 }
602
603 // Last check: must be organizer or attendee:
604
605 if (kcalPreferences()->thatIsMe(ev->organizer().email())) {
606 return true;
607 }
608
609 KCalendarCore::Attendee::List attendees = ev->attendees();
611 for (it = attendees.constBegin(); it != attendees.constEnd(); ++it) {
612 if (kcalPreferences()->thatIsMe((*it).email())) {
613 return true;
614 }
615 }
616
617 return false;
618}
619
620/*static*/
621QColor EventView::itemFrameColor(const QColor &color, bool selected)
622{
623 if (color.isValid()) {
624 return selected ? QColor(85 + color.red() * 2.0 / 3, 85 + color.green() * 2.0 / 3, 85 + color.blue() * 2.0 / 3) : color.darker(115);
625 } else {
626 return Qt::black;
627 }
628}
629
630QString EventView::iconForItem(const Akonadi::Item &item)
631{
632 Q_D(EventView);
633 QString iconName;
634 Akonadi::Collection collection = item.parentCollection();
635 while (collection.parentCollection().isValid() && collection.parentCollection() != Akonadi::Collection::root()) {
636 collection = Akonadi::EntityTreeModel::updatedCollection(d->model, collection.parentCollection());
637 }
638
639 if (collection.isValid() && collection.hasAttribute<Akonadi::EntityDisplayAttribute>()) {
640 iconName = collection.attribute<Akonadi::EntityDisplayAttribute>()->iconName();
641 }
642
643 return iconName;
644}
645
646void EventView::onCollectionChanged(const Akonadi::Collection &collection, const QSet<QByteArray> &changedAttributes)
647{
648 Q_UNUSED(collection)
649 if (changedAttributes.contains("AccessRights")) {
650 setChanges(changes() | EventViews::EventView::ResourcesChanged);
651 updateView();
652 }
653}
654
655QList<Akonadi::CollectionCalendar::Ptr> EventView::calendars() const
656{
657 Q_D(const EventView);
658 return d->mCalendars;
659}
660
661Akonadi::CollectionCalendar::Ptr EventView::calendar3(const Akonadi::Item &item) const
662{
663 return calendarForCollection(item.storageCollectionId());
664}
665
666Akonadi::CollectionCalendar::Ptr EventView::calendar3(const KCalendarCore::Incidence::Ptr &incidence) const
667{
668 const auto collectionId = incidence->customProperty("VOLATILE", "COLLECTION-ID").toLongLong();
669 return calendarForCollection(collectionId);
670}
671
672Akonadi::CollectionCalendar::Ptr EventView::calendarForCollection(Akonadi::Collection::Id collectionId) const
673{
674 const auto hasCollectionId = [collectionId](const Akonadi::CollectionCalendar::Ptr &calendar) {
675 return calendar->collection().id() == collectionId;
676 };
677
678 Q_D(const EventView);
679 const auto cal = std::find_if(d->mCalendars.cbegin(), d->mCalendars.cend(), hasCollectionId);
680 return cal != d->mCalendars.cend() ? *cal : Akonadi::CollectionCalendar::Ptr{};
681}
682
683Akonadi::CollectionCalendar::Ptr EventView::calendarForCollection(const Akonadi::Collection &collection) const
684{
685 return calendarForCollection(collection.id());
686}
687
688#include "moc_eventview.cpp"
bool isValid() const
static Collection root()
const T * attribute() const
Collection & parentCollection()
bool hasAttribute() const
static Collection updatedCollection(const QAbstractItemModel *model, qint64 collectionId)
Collection & parentCollection()
Collection::Id storageCollectionId() const
EventView is the abstract base class from which all other calendar views for event data are derived.
Definition eventview.h:69
virtual bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) const
Sets the default start/end date/time for new events.
virtual void updateView()=0
Updates the current display to reflect changes that may have happened in the calendar since the last ...
virtual QPair< QDateTime, QDateTime > actualDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth=QDate()) const
from the requested date range (passed via setDateRange()), calculates the adjusted date range actuall...
virtual QDateTime selectionEnd() const
Returns the end of the selection, or an invalid QDateTime if there is no selection or the view doesn'...
void showIncidenceSignal(const Akonadi::Item &)
instructs the receiver to show the incidence in read-only mode.
void setHolidayRegions(const QStringList &regions)
Set which holiday regions the user wants to use.
Definition eventview.cpp:91
bool dateRangeSelectionEnabled() const
Returns whether or not date range selection is enabled.
virtual QDateTime selectionStart() const
Returns the start of the selection, or an invalid QDateTime if there is no selection or the view does...
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.
~EventView() override
Destructor.
virtual EventView * viewAt(const QPoint &p)
returns the view at the given widget coordinate.
void newEventSignal()
instructs the receiver to create a new event in given collection.
virtual void flushView()
Write all unsaved data back to calendar store.
virtual void clearSelection()
Clear selection.
virtual void doRestoreConfig(const KConfigGroup &configGroup)
reimplement to read view-specific settings.
void defaultAction(const Akonadi::Item &incidence)
Perform the default action for an incidence, e.g.
Definition eventview.cpp:74
virtual bool supportsZoom() const
returns whether this view supports zoom.
EventView(QWidget *parent=nullptr)
Constructs a view.
Definition eventview.cpp:54
virtual void doSaveConfig(KConfigGroup &configGroup)
reimplement to write view-specific settings.
void setDateRangeSelectionEnabled(bool enable)
Enable or disable date range selection.
Changes changes() const
Returns if there are pending changes and a redraw is needed.
CalendarSupport::CollectionSelection * collectionSelection() const
Returns the selection of collection to be used by this view (custom if set, or global otherwise).
void restoreConfig(const KConfigGroup &configGroup)
reads the view configuration.
static QColor itemFrameColor(const QColor &color, bool selected)
Returns a variation of color that will be used for the border of an agenda or month item.
virtual void setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth=QDate())
void editIncidenceSignal(const Akonadi::Item &)
instructs the receiver to begin editing the incidence specified in some manner.
virtual void showDates(const QDate &start, const QDate &end, const QDate &preferredMonth=QDate())=0
void saveConfig(KConfigGroup &configGroup)
writes out the view configuration.
virtual void updateConfig()
Re-reads the configuration and picks up relevant changes which are applicable to the view.
virtual void setIncidenceChanger(Akonadi::IncidenceChanger *changer)
Assign a new incidence change helper object.
KConfigGroup group(const QString &group)
QString name() const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
KConfig * config()
QString readEntry(const char *key, const char *aDefault=nullptr) const
Q_SCRIPTABLE Q_NOREPLY void start()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(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
KCALUTILS_EXPORT int availableOccurrences(const KCalendarCore::Incidence::Ptr &incidence, const QDateTime &selectedOccurrence)
KCALUTILS_EXPORT int questionSelectedFutureAllCancel(const QString &message, const QString &caption, const KGuiItem &actionSelected, const KGuiItem &actionFuture, const KGuiItem &actionAll, QWidget *parent)
KCALUTILS_EXPORT int questionSelectedAllCancel(const QString &message, const QString &caption, const KGuiItem &actionSelected, const KGuiItem &actionAll, QWidget *parent)
KCOREADDONS_EXPORT QString randomString(int length)
const QList< QKeySequence > & preferences()
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void focusChanged(QWidget *old, QWidget *now)
QByteArray & replace(QByteArrayView before, QByteArrayView after)
int blue() const const
QColor darker(int factor) const const
int green() const const
bool isValid() const const
int red() const const
QCoreApplication * instance()
Type type() const const
int count() const const
bool isAutoRepeat() const const
int key() const const
Qt::KeyboardModifiers modifiers() const const
QString text() const const
const_iterator constBegin() const const
const_iterator constEnd() const const
const char * className() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual const QMetaObject * metaObject() const const
T qobject_cast(QObject *object)
bool contains(const QSet< T > &other) const const
QSharedPointer< X > staticCast() const const
bool isEmpty() const const
QByteArray toLatin1() const const
CaseInsensitive
QueuedConnection
Key_Return
ControlModifier
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.