diff --git a/src/ui/EventFilter.cpp b/src/ui/EventFilter.cpp index 45de3ce..987c608 100644 --- a/src/ui/EventFilter.cpp +++ b/src/ui/EventFilter.cpp @@ -7,6 +7,7 @@ #include "settings/SettingsComponent.h" #include "input/InputKeyboard.h" #include "KonvergoWindow.h" +#include #include #include @@ -85,6 +86,22 @@ bool EventFilter::eventFilter(QObject* watched, QEvent* event) } } } + + if (event->type() == QEvent::MouseButtonPress) + { + QMouseEvent* mouseEvent = dynamic_cast(event); + + if (mouseEvent) { + QQuickItem* webView = window->findChild("web"); + + if (mouseEvent->button() == Qt::BackButton) + QMetaObject::invokeMethod(webView, "goBack"); + + if (mouseEvent->button() == Qt::ForwardButton) + QMetaObject::invokeMethod(webView, "goForward"); + } + } + return QObject::eventFilter(watched, event); }