diff --git a/include/MainApplication.h b/include/MainApplication.h index 98fcdef20d9..e26fe677d56 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -49,10 +49,14 @@ class MainApplication : public QApplication MainApplication(int& argc, char** argv); bool event(QEvent* event) override; #ifdef LMMS_BUILD_WIN32 - bool winEventFilter(MSG* msg, long* result); - bool nativeEventFilter(const QByteArray& eventType, void* message, - long* result); -#endif +#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) + using FilterResult = long; +#else + using FilterResult = qintptr; +#endif // QT6 check + bool win32EventFilter(MSG* msg, FilterResult* result); + bool nativeEventFilter(const QByteArray& eventType, void* message, FilterResult* result); +#endif // LMMS_BUILD_WIN32 inline QString& queuedFile() { return m_queuedFile; diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index d33ede4d260..166be528c74 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -86,8 +86,8 @@ bool MainApplication::event(QEvent* event) } #ifdef LMMS_BUILD_WIN32 -// This can be moved into nativeEventFilter once Qt4 support has been dropped -bool MainApplication::winEventFilter(MSG* msg, long* result) +// Helper function for nativeEventFilter +bool MainApplication::win32EventFilter(MSG* msg, FilterResult* result) { switch(msg->message) { @@ -110,11 +110,11 @@ bool MainApplication::winEventFilter(MSG* msg, long* result) } bool MainApplication::nativeEventFilter(const QByteArray& eventType, - void* message, long* result) + void* message, FilterResult* result) { if(eventType == "windows_generic_MSG") { - return winEventFilter(static_cast(message), result); + return win32EventFilter(static_cast(message), result); } return false; }