How to get mouse event from QTabBar
-
wrote on 23 Oct 2013, 09:31 last edited by
Hi
I want track mouse events occurring in the QTabBar widget inside my QTabWidget but dont see how to do this.I would be grateful if someone could provide some hints
Thanks
-
Hi,
You can look for the QTabBar using findChild and install an eventFilter on it
Hope it helps
-
wrote on 15 Jan 2014, 21:44 last edited by
Hi,
ich have near the same problem with the Handlich of QTabBar.
I need do use a mouse-right-click for a special handling by changing the tabs. But I did not find out how to impelent the eventFilter mousePressEvent for that. I can fetch the right click, left clicks, but I am not able to make the same handling by the right click (setting the tab as activ).
So for what should this be done: I want to change the tab by left click and fill in some 'special' data into that QTabWidget.
I want to use the right click in the same way, but I want to fill 'all' (different fillings into lists) data into that QTabWidget.
There are the same elements only different content.I hope you could understand my text, I am a nuub in programming and english.
Thx for help !!!
-
wrote on 16 Jan 2014, 12:14 last edited by
Hi all,
do I have to open a new discussion to get an answer, ist this here the wrog place ? please give me a hint.
Thx
-
Please practice some patience, waiting 24 to 72 hours before bumping your question is common. Not everybody on this forum lives in the same timezone as you.
What did you already try ?
-
wrote on 18 Jan 2014, 05:12 last edited by
I tried a lot and now I am so confused ..
I installed an eventFilter so far so good.
I am able to get 'QT::LeftButton' and 'QT::RightButton' and the event 'QT::MouseButtonPressed'.Now I want to indentify the clicked Tab by index (if possible) in QTabBar (even left or right mousebutton has been used to click) - this is not possible.
I need the index from the clicked Tab because I want to have the same behavior like we have with the left one. Only some data should be different shown.
I think I will give up, I have no more Ideas.
-
You can also subclass QTabBar and set it on your QTabWidget, it will be easier to play with the tabs in there.