Results 1 to 2 of 2

Thread: Stop mouse event and start on another widget

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation Stop mouse event and start on another widget

    Hi,
    I made a tabbed window system, when the user click on one tab if the mouse move is outside the tabbar that create a new tabbed window with the window inside it.
    The problem is the mouse event, when the new window is created the mouse event of the tabbar has to be stopped, but how do that correctly ?
    Another problem is when the user tab from one tabbar to another, the mouse event has to be stopped on the first and start on the new tabbar.
    If the second problem is solved, surely the first is solved the same time, but how solve that ?
    Maybe Qt has a way to emulate the mouse press event ? Or a better way to solve that ?
    Thanks for the help

    EDIT : Maybe that's better to have a function in the tabbar to enable a flag "IsDragging" which is called on the new tabbar when the user do the action ?
    Last edited by Alundra; 24th March 2015 at 04:18.

  2. #2
    Join Date
    Oct 2014
    Posts
    81
    Thanks
    20
    Thanked 9 Times in 9 Posts
    Qt products
    Qt5
    Platforms
    Windows
    Wiki edits
    7

    Default Re: Stop mouse event and start on another widget

    That's exactly the same problem in that detachable dock example we've discussed before: how to "clear" or reset the mouse grabbing state of a widget?

    The only way I found that works is to emit an OS-level mouse event, a synthetic mouse release event from the OS API. I would also like to know if there's a more internal, platform agnostic way.
    I've tried asking a developer but it isn't a supported use case: https://bugreports.qt.io/browse/QTBUG-43698

    You can't use an event filter for this, because when you get to the event filter body the tab bar is already grabbing the mouse.

Similar Threads

  1. QT Mouse Event outside Window/Widget
    By digimonkey in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2014, 11:23
  2. Replies: 2
    Last Post: 28th April 2011, 19:21
  3. Mouse event handling beyond/outside the widget
    By keyur259 in forum Qt Programming
    Replies: 7
    Last Post: 20th January 2010, 05:14
  4. Replies: 7
    Last Post: 14th January 2010, 08:47
  5. pass mouse event information to another widget
    By Rooster in forum Qt Programming
    Replies: 5
    Last Post: 12th July 2008, 04:23

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.