From edf2269cc327367863c99d6216ef9bdbc98b0e0c Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Mon, 10 Oct 2016 19:54:03 +0000 Subject: [PATCH] send unfocused mouse events to the widget under the cursor --- minibrowser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/minibrowser.cpp b/minibrowser.cpp index 45090bb..9656f34 100644 --- a/minibrowser.cpp +++ b/minibrowser.cpp @@ -147,8 +147,10 @@ void MiniBrowser::onMouseInput(QtMouse mouse) { // shift focus to the widget we just clicked on QWidget *w = qApp->widgetAt(m_mousePos); - if(w) + if(w) { w->setFocus(); + widget = w; + } } QMouseEvent *pressEvent = new QMouseEvent(QEvent::MouseButtonPress, widget->mapFromGlobal(mouse.newPos), mouse.newPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);