From 1f0961d574c327f580ddd45d8b494a11b0c0c1da Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 18 Jul 2020 04:15:42 +0200 Subject: [PATCH] Make MainWindow::nativeEvent compatible with Qt 6 --- src/core/mainwindow.cpp | 4 ++++ src/core/mainwindow.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index ab54d3dc8..f5d018bfe 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -2537,7 +2537,11 @@ void MainWindow::Raise() { activateWindow(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, qintptr *result) { +#else bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) { +#endif Q_UNUSED(eventType); Q_UNUSED(result); diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index bab076022..e67b75e46 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -112,7 +112,11 @@ class MainWindow : public QMainWindow, public PlatformInterface { protected: void keyPressEvent(QKeyEvent *event) override; void closeEvent(QCloseEvent *event) override; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; +#else bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; +#endif // PlatformInterface void Activate() override;