Results 1 to 2 of 2

Thread: Maya Style Right Click Menus in Qt

  1. #1
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Maya Style Right Click Menus in Qt

    I would like to implement something like the maya-style right click menus (also called marking menus):

    http://discussion.autodesk.com/servl...arkingMenu.jpg

    I was thinking the easiest way would be, say, if I have six choices I want to show, then just create six QMenu objects and display them radially around the mouse using popup(), but I tried a sample real fast, and the mouse focus only works on the most recently displayed QMenu object.

    Ultimately I would want something as powerful as Qt PieMenu, but that seems to be only available for the commercial version of Qt. Does anyone have any ideas as to how to start implementing these radial right click menus with Qt opensource?

    Thanks for the help,
    dave

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Maya Style Right Click Menus in Qt

    Shouldn't be that hard... Basically you're after a popup widget that may have a non-rectangular shape (obtained using setMask()) that triggers actions. The first big question is whether to subclass QMenu for that functionality or not. Looking at QMenu docs you'll notice there are no virtual methods to reimplement (obviously :P) so there won't be any benefit or subclassing QMenu for the job. So you should go for a QWidget (or QDialog) subclass and use addAction and handle QActionEvents to modify your custom menu.
    Then it's a matter of reimplementing releaseMouseEvent to handle clicks and maybe mouseMoveEvent (with mouse tracking enabled) to provide some eye candy.

Similar Threads

  1. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  2. More problems with Menus and Toolbars
    By mridey in forum Qt Tools
    Replies: 2
    Last Post: 16th November 2006, 11:37

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.