Merge bitcoin-core/gui#840: qt6: Handle different signatures of QANEF::nativeEventFilter

80761afced qt6: Handle different signatures of `QANEF::nativeEventFilter` (Hennadii Stepanov)

Pull request description:

  Split from https://github.com/bitcoin/bitcoin/pull/30997.

  This PR ensures compatibility across all supported Qt versions.

  For more details, please refer to 3b38c73c7f.

  No behaviour change.

ACKs for top commit:
  maflcko:
    lgtm ACK 80761afced
  promag:
    Code review ACK 80761afced.

Tree-SHA512: a265e1c33cc7da37003bb0e6fd40950acb5e948ca9ec63a59a79c5e2a1894334f48d5565539c91d4d777b48a589366958df1498eaa6935e3b7fb534493adb51a
This commit is contained in:
Hennadii Stepanov 2024-10-07 10:27:50 +01:00
commit 1b70714671
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 8 additions and 0 deletions

View file

@ -12,7 +12,11 @@
// If we don't want a message to be processed by Qt, return true and set result to
// the value that the window procedure should return. Otherwise return false.
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, qintptr *pnResult)
#else
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult)
#endif
{
Q_UNUSED(eventType);

View file

@ -20,7 +20,11 @@ public:
WinShutdownMonitor(std::function<void()> shutdown_fn) : m_shutdown_fn{std::move(shutdown_fn)} {}
/** Implements QAbstractNativeEventFilter interface for processing Windows messages */
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, qintptr *pnResult) override;
#else
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) override;
#endif
/** Register the reason for blocking shutdown on Windows to allow clean client exit */
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);