send unfocused mouse events to the widget under the cursor

This commit is contained in:
Brad Parker 2016-10-10 19:54:03 +00:00
parent e5a0ab93ac
commit edf2269cc3

View File

@ -147,8 +147,10 @@ void MiniBrowser::onMouseInput(QtMouse mouse) {
// shift focus to the widget we just clicked on // shift focus to the widget we just clicked on
QWidget *w = qApp->widgetAt(m_mousePos); QWidget *w = qApp->widgetAt(m_mousePos);
if(w) if(w) {
w->setFocus(); w->setFocus();
widget = w;
}
} }
QMouseEvent *pressEvent = new QMouseEvent(QEvent::MouseButtonPress, widget->mapFromGlobal(mouse.newPos), mouse.newPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent *pressEvent = new QMouseEvent(QEvent::MouseButtonPress, widget->mapFromGlobal(mouse.newPos), mouse.newPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);