From ecf0d7659bd888cc0aa0f067d93bcf910cd5eeb1 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 23 Jul 2023 18:40:32 +0300 Subject: [PATCH] libs: do not grab and ugrab the keyboard from the calendar focus change events QCalendardWidget (and consequently KCalendarWidget) focus policy is set to Qt::StrongFocus by default Signed-off-by: Ivailo Monev --- libs/plasmaclock/calendar.cpp | 12 ------------ libs/plasmaclock/calendar.h | 2 -- 2 files changed, 14 deletions(-) diff --git a/libs/plasmaclock/calendar.cpp b/libs/plasmaclock/calendar.cpp index afe31252..c2c49919 100644 --- a/libs/plasmaclock/calendar.cpp +++ b/libs/plasmaclock/calendar.cpp @@ -126,18 +126,6 @@ void CalendarPrivate::init(const QDate &initialDate) updateSize(); } -void Calendar::focusInEvent(QFocusEvent* event) -{ - Q_UNUSED(event); - grabKeyboard(); -} - -void Calendar::focusOutEvent(QFocusEvent* event) -{ - Q_UNUSED(event); - ungrabKeyboard(); -} - void Calendar::keyPressEvent(QKeyEvent* event) { switch(event->key()) { diff --git a/libs/plasmaclock/calendar.h b/libs/plasmaclock/calendar.h index 39af0b2a..5c0f6c96 100644 --- a/libs/plasmaclock/calendar.h +++ b/libs/plasmaclock/calendar.h @@ -68,8 +68,6 @@ Q_SIGNALS: protected: void keyPressEvent(QKeyEvent * event); - void focusInEvent(QFocusEvent * event); - void focusOutEvent(QFocusEvent * event); void showEvent(QShowEvent * event); private Q_SLOTS: