QAbstractNativeEventFilter: Add a Windows example
Change-Id: Ic378174e7f192abc27524cbcd925705c8bb46502 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
357db9ceab
commit
aa69457533
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2022 Laszlo Papp <lpapp@kde.org>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
//! [0]
|
||||
class MyMSGEventFilter : public QAbstractNativeEventFilter
|
||||
{
|
||||
public:
|
||||
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override
|
||||
{
|
||||
if (eventType == "windows_generic_MSG") {
|
||||
MSG *msg = static_cast<MSG *>(message);
|
||||
// ...
|
||||
} else if (eventType == "windows_dispatcher_MSG") {
|
||||
MSG *msg = static_cast<MSG *>(message);
|
||||
// ...
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
//! [0]
|
@ -69,6 +69,9 @@ QAbstractNativeEventFilter::~QAbstractNativeEventFilter()
|
||||
\b {Linux example}
|
||||
\snippet code/src_corelib_kernel_qabstractnativeeventfilter.cpp 0
|
||||
|
||||
\b {Windows example}
|
||||
\snippet code/src_corelib_kernel_qabstractnativeeventfilter_win.cpp 0
|
||||
|
||||
\b {macOS example}
|
||||
|
||||
mycocoaeventfilter.h:
|
||||
|
Loading…
Reference in New Issue
Block a user