Results 1 to 8 of 8

Thread: DockWidget undock + mouseTracking

  1. #1
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Smile DockWidget undock + mouseTracking

    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!
    Last edited by thibs; 5th January 2017 at 17:29. Reason: updated contents

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: DockWidget undock + mouseTracking

    You either have to track the movement of the window or you try installing an event filter in the QApplicatiomn object.

    Cheers,
    _

  3. #3
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: DockWidget undock + mouseTracking

    Thanks anda_skoa! I did using the signal top_level_changed and using mouse event filter too.

  4. #4
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Lightbulb MouseEvents in a dockWidget undocked

    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!

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MouseEvents in a dockWidget undocked

    On which object did you install the event filter?

    Cheers,
    _

  6. #6
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: MouseEvents in a dockWidget undocked

    in my dockWidgets

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MouseEvents in a dockWidget undocked

    Then try installing it on the application object as suggested above.

    All events pass through that.

    Cheers,
    _

  8. #8
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: MouseEvents in a dockWidget undocked

    I used the NonClientArea events, which solved my problem!

Similar Threads

  1. QVTKWidget + Dock/undock + MAC OS.
    By rakeshthp in forum Qt Programming
    Replies: 3
    Last Post: 8th February 2016, 17:53
  2. Dock/Undock of Tabs in QTabWidget
    By Arjun in forum Qt Programming
    Replies: 2
    Last Post: 3rd November 2015, 18:14
  3. [MAC OSX] Mousetracking does not work in VideoWidget
    By Markus in forum Qt Programming
    Replies: 0
    Last Post: 2nd October 2010, 00:23
  4. undock QDockWidget
    By chemstar in forum Qt Programming
    Replies: 1
    Last Post: 1st September 2006, 12:11
  5. mouseTracking
    By mickey in forum Newbie
    Replies: 1
    Last Post: 16th April 2006, 06:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.