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:

Qt Code:
  1. void GLWidget::mousePressEvent(QMouseEvent *event)
  2. {
  3. lastPos = event->pos();
  4. }
To copy to clipboard, switch view to plain text mode 

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.