Atomic_Sheep
24th April 2013, 12:28
Hi guys, have a nooby question on mouse events.
When you create a window into which you'll put a widget that will then track mouse clicks etc, why are we creating:
void GLWidget::mousePressEvent(QMouseEvent *event)
{
lastPos = event->pos();
}
Inside the Widget and not inside the window that is the container for our widget? I don't know why, but to me it seems more logical that the window is what will track the mouse location and mouse events rather than a widget created inside the window.
When you create a window into which you'll put a widget that will then track mouse clicks etc, why are we creating:
void GLWidget::mousePressEvent(QMouseEvent *event)
{
lastPos = event->pos();
}
Inside the Widget and not inside the window that is the container for our widget? I don't know why, but to me it seems more logical that the window is what will track the mouse location and mouse events rather than a widget created inside the window.