Results 1 to 2 of 2

Thread: multi level menu popup

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default multi level menu popup

    I want to have a multi level context menu popup when I right click
    in myWidget.

    Right clicking shows 'Display', which when moved to with the cursor
    then shows the option menu items...

    Display >
    Option 1
    Option 2
    Option 3

    I've got the 'Display' to popup, but how to I get the second
    level of popup?

    Devices_table->setContextMenuPolicy( Qt::CustomContextMenu );
    m_Columnmenu = new QMenu( this );
    m_ColumnDisplayAction = new QAction(tr("Display"), this);
    m_Columnmenu->addAction( m_ColumnDisplayAction );

    Mark

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: multi level menu popup

    QMenu::addMenu():
    Qt Code:
    1. m_Displaymenu = m_Columnmenu->addMenu(tr("Display"));
    2. m_Displaymenu->addAction("...");
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Popup menu for a QGraphicsItem?
    By Morea in forum Qt Programming
    Replies: 4
    Last Post: 4th February 2009, 21:27
  2. PopUp a Menu when showing FullScreen
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2007, 10:04
  3. ListView Dynamic Popup menu
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 14th October 2006, 19:26
  4. Background image on popup menu item
    By MarkoSan in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 27th June 2006, 05:55
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

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.