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