From 6fbb75527755c7588e852d629930e0e320e1fa85 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 16 Apr 2022 04:11:08 +0200 Subject: [PATCH] Qt6 already has a closeEvent on QQuickView --- src/MainWindow.cpp | 12 ------------ src/MainWindow.h | 3 +-- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e8b7a341..0ccbc5c8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -156,18 +156,6 @@ MainWindow::setWindowTitle(int notificationCount) QQuickView::setTitle(name); } -bool -MainWindow::event(QEvent *event) -{ - auto type = event->type(); - - if (type == QEvent::Close) { - closeEvent(static_cast(event)); - } - - return QQuickView::event(event); -} - void MainWindow::restoreWindowSize() { diff --git a/src/MainWindow.h b/src/MainWindow.h index fd1e1174..a111b91b 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -81,8 +81,7 @@ public: #endif protected: - void closeEvent(QCloseEvent *event); - bool event(QEvent *event) override; + void closeEvent(QCloseEvent *event) override; private slots: //! Handle interaction with the tray icon.