From 8c403d5dd03418febd67d50c6d9094a61c036f9b Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周一, 11 12月 2023 14:43:40 +0800 Subject: [PATCH] Add virtual hook --- src/core/contexts/abstractwindowcontext_p.h | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext_p.h b/src/core/contexts/abstractwindowcontext_p.h index 28ff0de..fde76b0 100644 --- a/src/core/contexts/abstractwindowcontext_p.h +++ b/src/core/contexts/abstractwindowcontext_p.h @@ -9,12 +9,11 @@ #include <QtGui/QPolygon> #include <QWKCore/windowagentbase.h> -#include <QWKCore/sharedeventfilter.h> #include <QWKCore/private/windowitemdelegate_p.h> namespace QWK { - class QWK_CORE_EXPORT AbstractWindowContext : public QObject, public SharedEventDispatcher { + class QWK_CORE_EXPORT AbstractWindowContext : public QObject { Q_OBJECT public: AbstractWindowContext(); @@ -36,16 +35,22 @@ inline const QObject *titleBar() const; bool setTitleBar(const QObject *obj); - virtual void showSystemMenu(const QPoint &pos); + void showSystemMenu(const QPoint &pos); QRegion hitTestShape() const; bool isInSystemButtons(const QPoint &pos, WindowAgentBase::SystemButton *button) const; bool isInTitleBarDraggableArea(const QPoint &pos) const; + virtual QString key() const; + + enum WindowContextHook { + CentralizeHook = 1, + ShowSystemMenuHook, + }; + virtual void virtual_hook(int id, void *data); + protected: virtual bool setupHost() = 0; - - QObject *target() const override; protected: QObject *m_host; -- Gitblit v1.9.1