Results 1 to 3 of 3

Thread: disable QMainWindow toolbar menu?

  1. #1
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Thanks
    55
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default disable QMainWindow toolbar menu?

    When using QMainWindow, you can right-click in the toolbar area to get a popup menu that displays the names of the toolbars in a checkmark list (the active toolbars are checked), and you uncheck the checkmark to remove a toolbar from the main window or check it to activate the toolbar.

    How to disable this menu?
    Software Engineer



  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: disable QMainWindow toolbar menu?

    setDockMenuEnabled(false);

  3. #3
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Thanks
    55
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: disable QMainWindow toolbar menu?

    Above works in Qt3. For Qt4+, override in your QMainWindow class:

    Qt Code:
    1. QMenu* createPopupMenu() { return NULL; }
    To copy to clipboard, switch view to plain text mode 
    Software Engineer



  4. The following user says thank you to gfunk for this useful post:

    ntp (1st August 2007)

Similar Threads

  1. Tracking separators in a menu (insertSeparator)
    By PrimeCP in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2006, 19:10

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.