Results 1 to 6 of 6

Thread: Closing out a animated context menu from any active screen

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    122
    Thanks
    62
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Smile Closing out a animated context menu from any active screen

    I have written an application in QtCreator using standard widgets and animation content where the GUI mimics very closely that of modern smartphones (i.e. kinectic scrolling lists, animated screen transitions, integrated editors, etc.). I have a sliding content menu similar to a modern smartphone based on the use of an external command button. I want to close out this menu whenever the user presses anywhere in the application area. Mouse clicks within the content menu are handled with a button selection. However, I need to also hide the content menu if the user presses the mouse anywhere in the application area. The application has a dozen or more screens which could be active at any time with the content menu. Some of these screens have additional nesting, such as context specific editors, with individual widgets. This is show in the sample attached screenshot.

    So my question is, what is the most efficient way of capture all mouse presses in the client area outside of the content menu itself. My preliminary implementation is to have each screen provide a signal within it's MousePress event, so the parent application can close out the content menu. However, I would prefer not having to implement this for each and every screen/form if there is a more efficient centralized way of doing it (from say the parent screen which contains the fixed header and footer components of the GUI).

    It there a better way of implementing this other than having to add a mousePressEvent() handler to each child screen (or perhaps having each screen/form derive from a common base class containing this feature?).

    Is there some form of mouse capture that can be performed when the context menu is made visible that could capture all mouse presses within the application, and then perhaps release this mouse capture upon menu closure. I need to eat the mouse press event outside the bounds of the context menu.

    Since mouse presses may be frequent, I would prefer not to have to signal for each one.
    Attached Images Attached Images

Similar Threads

  1. Context menu on tab
    By wolfi3b in forum Newbie
    Replies: 2
    Last Post: 18th October 2010, 17:35
  2. Detecting whether a context menu is currently active
    By Andrew Top in forum Qt Programming
    Replies: 0
    Last Post: 14th April 2010, 17:23
  3. Context menu
    By dejvis in forum Newbie
    Replies: 2
    Last Post: 20th September 2009, 22:02
  4. Qwt and context menu
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 9th December 2008, 08:55
  5. Context Menu
    By RY in forum Newbie
    Replies: 1
    Last Post: 10th September 2008, 07:59

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
  •  
Qt is a trademark of The Qt Company.