1

Is it possible for the QGLWidget to propagate its mouse event?

I currently have a QGlWidget as a child of my main window, but I can't seem to handle the mouse events occurring over it's frame.

Perhaps I'm making a fundamental flaw, but the mouse events within the qglwidet itself are set to event->accept(), and I'm not blocking outgoing signals from the qglwidget either.

I have a work around where I simply emit new signals from within each mouse event in the qglwidget, and connect them within my main window, but I'm just curious if this is a known problem, I'm doing it wrong, or if it's not possible at all.

Yattabyte
  • 1,280
  • 14
  • 28

1 Answers1

0

From the Qt documentation about accepting an event :

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.

So when you accept the mouse event on the widget, it would not be propagated to the main window. You can handle the event in the QGlWidget but it's not necessary to set the accept flag. Just leave it to be propagated to the parent.

Nejat
  • 31,784
  • 12
  • 106
  • 138