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

QCocoaMenuBar crash when adding shared menu

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.1.0 Beta 1
    • Fix Version/s: 5.1.0 RC1
    • Labels:
      None
    • Environment:
      OS X 10.8, Qt 5.1.0
    • Commits:
      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes