QWidget::mousePressEvent() fail to capture the left click event
-
Hi all,
As the title mentions, I define that event for my tab widget.
I expect that when the user clicks the tab, mousePressEvent can be called. However, I notice that only the right click is detected instead of the left click.I have even tried to implement the event filter, and I notice that both left and right clicks on the tab can trigger the QEvent::MouseButtonPress.
I am wondering why the left click on the tab can not be detected from QWidget::mousePressEvent()
-
Hi all,
As the title mentions, I define that event for my tab widget.
I expect that when the user clicks the tab, mousePressEvent can be called. However, I notice that only the right click is detected instead of the left click.I have even tried to implement the event filter, and I notice that both left and right clicks on the tab can trigger the QEvent::MouseButtonPress.
I am wondering why the left click on the tab can not be detected from QWidget::mousePressEvent()
@www111 said in QWidget::mousePressEvent() fail to capture the left click event:
I expect that when the user clicks the tab
I don't know for sure, and I don't know about your right click, but if you are clicking on the "tab" in the sense of the tab bar rather than the widget area then do mouse clicks go to the QTabBar *QTabWidget::tabBar() const?
-
Hi all,
As the title mentions, I define that event for my tab widget.
I expect that when the user clicks the tab, mousePressEvent can be called. However, I notice that only the right click is detected instead of the left click.I have even tried to implement the event filter, and I notice that both left and right clicks on the tab can trigger the QEvent::MouseButtonPress.
I am wondering why the left click on the tab can not be detected from QWidget::mousePressEvent()
-
I suspect that some other widget takes ("accepts") the mouse event, so it's not propagated to the tab event handler anymore.