Results 1 to 6 of 6

Thread: QToolBar: How do you suppress the right-click menu that allows hiding the toolbar?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Location
    India
    Posts
    50
    Thanks
    1
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile Re: QToolBar: How do you suppress the right-click menu that allows hiding the toolbar

    Just Override QMenu * QMainWindow::createPopupMenu ()

    QMenu * MyMainWindow::createPopupMenu ()
    {
    return NULL;
    }

  2. The following user says thank you to agathiyaa for this useful post:

    Lawand (27th March 2011)

  3. #2
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QToolBar: How do you suppress the right-click menu that allows hiding the toolbar

    Found a nice answer on StackOverflow. Just call:

    Qt Code:
    1. setContextMenuPolicy(Qt::NoContextMenu);
    To copy to clipboard, switch view to plain text mode 

    inside your QMainWindow subclass.

    http://stackoverflow.com/questions/6...lbar-unhidable

  4. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QToolBar: How do you suppress the right-click menu that allows hiding the toolbar

    That information was already in this thread two years ago

Similar Threads

  1. Hiding a QToolButton in a QToolBar
    By elcuco in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2009, 20:35
  2. Hiding mac system menu in fullscreen mode
    By jupi32000 in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 19:32
  3. QToolBar double click
    By sdfisher in forum Qt Programming
    Replies: 4
    Last Post: 8th October 2007, 06:19
  4. ToolBar Action With Menu
    By indifference in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2007, 19:37
  5. Toolbar show menu
    By Michiel in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2007, 15:22

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