Skip to content

Commit 1b70714

Browse files
committed
Merge bitcoin-core#840: qt6: Handle different signatures of QANEF::nativeEventFilter
80761af qt6: Handle different signatures of `QANEF::nativeEventFilter` (Hennadii Stepanov) Pull request description: Split from bitcoin/bitcoin#30997. This PR ensures compatibility across all supported Qt versions. For more details, please refer to qt/qtbase@3b38c73. No behaviour change. ACKs for top commit: maflcko: lgtm ACK 80761af promag: Code review ACK 80761af. Tree-SHA512: a265e1c33cc7da37003bb0e6fd40950acb5e948ca9ec63a59a79c5e2a1894334f48d5565539c91d4d777b48a589366958df1498eaa6935e3b7fb534493adb51a
2 parents ec58dfe + 80761af commit 1b70714

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/qt/winshutdownmonitor.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
// If we don't want a message to be processed by Qt, return true and set result to
1414
// the value that the window procedure should return. Otherwise return false.
15+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
16+
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, qintptr *pnResult)
17+
#else
1518
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult)
19+
#endif
1620
{
1721
Q_UNUSED(eventType);
1822

src/qt/winshutdownmonitor.h

+4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class WinShutdownMonitor : public QAbstractNativeEventFilter
2020
WinShutdownMonitor(std::function<void()> shutdown_fn) : m_shutdown_fn{std::move(shutdown_fn)} {}
2121

2222
/** Implements QAbstractNativeEventFilter interface for processing Windows messages */
23+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
24+
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, qintptr *pnResult) override;
25+
#else
2326
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) override;
27+
#endif
2428

2529
/** Register the reason for blocking shutdown on Windows to allow clean client exit */
2630
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);

0 commit comments

Comments
 (0)