I'm unable to successfully capture a mouse click in my QMainWindow for subclassed child widgets, such those that live inside a subclassed QTabWidget, like buttons, QTextEdits, etc.
I install a mousePressEvent() filter on the QMainWindow class.
Qt Code:
{ qDebug() << "mousePressEvent"; }To copy to clipboard, switch view to plain text mode
I also pass the QMainWindow parent pointer to the subclassed child QTabWidget.
When I click around in the UI, I get a successful mouse press event if I click on whitespace (such as the tab widget frame). Good.
But I do not get a mouse press event if I click on any QWidget inside the QTabWidget, such as buttons or a text edit. These widgets would (I suppose) be grand-children of the QMainWindow.
Shouldn't I be able to install a mouse event filter on the parent and receive events for a click on any subclassed descendant? Or, do I need event filters at all child levels?
Bookmarks