From 09287f3d9e9e88271de2bfd5388dae5a53e8c6f5 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: ćšć, 07 12æ 2023 15:03:24 +0800 Subject: [PATCH] Add host event filter --- src/core/contexts/abstractwindowcontext_p.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext_p.h b/src/core/contexts/abstractwindowcontext_p.h index b1202ea..30ea3c1 100644 --- a/src/core/contexts/abstractwindowcontext_p.h +++ b/src/core/contexts/abstractwindowcontext_p.h @@ -16,11 +16,11 @@ class QWK_CORE_EXPORT AbstractWindowContext : public QObject { Q_OBJECT public: - AbstractWindowContext(QObject *host, WindowItemDelegate *delegate); + AbstractWindowContext(); ~AbstractWindowContext() override; public: - virtual bool setup() = 0; + bool setup(QObject *host, WindowItemDelegate *delegate); inline QObject *host() const; inline QWindow *window() const; @@ -42,6 +42,10 @@ bool isInTitleBarDraggableArea(const QPoint &pos) const; protected: + virtual bool setupHost() = 0; + virtual bool hostEventFilter(QEvent *event); + + protected: QObject *m_host; std::unique_ptr<WindowItemDelegate> m_delegate; QWindow *m_windowHandle; -- Gitblit v1.9.1