PDA

View Full Version : DockWidget undock + mouseTracking



thibs
5th January 2017, 12:36
Hey guys,

So, what I'm trying to do is implement arrows to guide the user to dock dockWidgets. To do so, I have to track the mouse after the dockWidget is undocked and check whether is over the arrow or not.

What I did so far: show the arrows after undock, but i tried to use moseEvents to detect whether the cursors enters the QLabel that has the arrows. The problem is the mouse is pressed dragging the dock, so the mouse event doesn't happen.

Thanks in advance!

anda_skoa
6th January 2017, 09:43
You either have to track the movement of the window or you try installing an event filter in the QApplicatiomn object.

Cheers,
_

thibs
19th January 2017, 13:49
Thanks anda_skoa! I did using the signal top_level_changed and using mouse event filter too.

thibs
19th January 2017, 13:53
Hey guys,

The problem I'm facing is to detect any mouseEvents in a dockWidget which is undocked. When is docked, I use an eventFilter to detect mouse events which work just fine. However, if I undock the dock and release it in a non-dockArea, when I press the mouse in the dock again, my code doesn't recognize any event at alll.

Any suggestions?

Thanks!

anda_skoa
19th January 2017, 15:25
On which object did you install the event filter?

Cheers,
_

thibs
20th January 2017, 16:23
in my dockWidgets

anda_skoa
21st January 2017, 11:31
Then try installing it on the application object as suggested above.

All events pass through that.

Cheers,
_

thibs
13th February 2017, 15:26
I used the NonClientArea events, which solved my problem!