From 751512979661adb91e9da7fd00ee00ad02a25058 Mon Sep 17 00:00:00 2001 From: Andrettin <6322423+Andrettin@users.noreply.github.com> Date: Sat, 24 Feb 2024 18:15:27 +0100 Subject: [PATCH] Fix to engine_interface::eventFilter() for Qt6 --- src/stratagus/engine_interface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stratagus/engine_interface.cpp b/src/stratagus/engine_interface.cpp index 37bf14901..f522a0229 100644 --- a/src/stratagus/engine_interface.cpp +++ b/src/stratagus/engine_interface.cpp @@ -218,7 +218,7 @@ bool engine_interface::eventFilter(QObject *source, QEvent *event) return true; } - this->store_input_event(std::make_unique(*mouse_event)); + this->store_input_event(std::unique_ptr(static_cast(mouse_event->clone()))); return true; } case QEvent::HoverEnter: @@ -235,13 +235,13 @@ bool engine_interface::eventFilter(QObject *source, QEvent *event) return true; } - this->store_input_event(std::make_unique(*hover_event)); + this->store_input_event(std::unique_ptr(static_cast(hover_event->clone()))); return true; } case QEvent::KeyPress: case QEvent::KeyRelease: { const QKeyEvent *key_event = static_cast(event); - this->store_input_event(std::make_unique(*key_event)); + this->store_input_event(std::unique_ptr(static_cast(key_event->clone()))); if (key_event->key() == Qt::Key_Tab || key_event->key() == Qt::Key_Backtab) { return true; //consume tab events to prevent tab focus switching