Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31342

QCocoaMenuBar crash when adding shared menu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.1.0 RC1
    • 5.1.0 Beta 1
    • None
    • OS X 10.8, Qt 5.1.0
    • 119882714f87ffeb6945fdb2d02997ae125ff50c

    Description

      When i try to add same QMenu object to a 2 different QMenuBar objects, i get NSException throwing which says "Item to be inserted into menu already is in another menu". This leads to application crash.

      It seems to be a regression from Qt4.
      This happens because each QCocoaMenu stores associated NSMenuItem, which can be added only to one NSMenu object. It seems, that menu should store multiple NSMenuItems, one for each menu bar, which menu is added to.

      Or, if adding same QMenu to different menu bars is no longer supported, that should be properly documented and should not lead to crash.

      Attachments

        Issue Links

          Activity

            People

              rperier Romain Perier
              arch Ivan Komissarov
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: