QWindowKit  1.5.1.0
Cross-platform window customization framework
Loading...
Searching...
No Matches
sharedeventfilter_p.h
1// Copyright (C) 2023-present Stdware Collections (https://www.github.com/stdware)
2// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
3// SPDX-License-Identifier: Apache-2.0
4
5#ifndef SHAREDEVENTFILTER_P_H
6#define SHAREDEVENTFILTER_P_H
7
8//
9// W A R N I N G !!!
10// -----------------
11//
12// This file is not part of the QWindowKit API. It is used purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or may even be removed.
15//
16
17#include <QWKCore/qwkglobal.h>
18
19namespace QWK {
20
21 class SharedEventFilter;
22
23 class QWK_CORE_EXPORT SharedEventDispatcher {
24 public:
25 SharedEventDispatcher();
26 virtual ~SharedEventDispatcher();
27
28 public:
29 virtual bool sharedDispatch(QObject *obj, QEvent *event);
30
31 public:
32 void installSharedEventFilter(SharedEventFilter *filter);
33 void removeSharedEventFilter(SharedEventFilter *filter);
34
35 protected:
36 QList<SharedEventFilter *> m_sharedEventFilters;
37
38 int m_sharedDispatchDepth = 0;
39
40 friend class SharedEventFilter;
41
42 Q_DISABLE_COPY(SharedEventDispatcher)
43 };
44
45 class QWK_CORE_EXPORT SharedEventFilter {
46 public:
47 SharedEventFilter();
48 virtual ~SharedEventFilter();
49
50 public:
51 virtual bool sharedEventFilter(QObject *obj, QEvent *event) = 0;
52
53 protected:
54 SharedEventDispatcher *m_sharedDispatcher = nullptr;
55
56 friend class SharedEventDispatcher;
57
58 Q_DISABLE_COPY(SharedEventFilter)
59 };
60
61}
62
63#endif // SHAREDEVENTFILTER_P_H
QWindowKit namespace.
Definition abstractwindowcontext.cpp:13