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

On Qt for Cocoa, the application crashes when a menu is present twice in the menu bar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.5.3
    • 4.5.2
    • Widgets: Main Window
    • None
    • faec535829a0e454a6784b0c5c37cb63e7da8f73

    Description

      On Mac OS X, with Cocoa, when a menu is added in diffferent place of the interfaces, the application crashes.

      On Cocoa, [NSMenuItem setSubenu] raises an exception if the menu already have a sub menu( http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMenuItem_Class/Reference/Reference.html#//apple_ref/occ/instm/NSMenuItem/setSubmenu: )

      Here is an example to reproduce the issue:

      #include <QtGui>

      int main(int argc, char **argv) {
      QApplication app(argc, argv);
      QMainWindow main;

      QMenu menu("menu");
      menu.addAction("entry");
      main.menuBar()->addMenu(&menu);

      QMenu mainMenu("mainmenu");
      main.menuBar()->addMenu(&mainMenu);
      mainMenu.addMenu(&menu);
      main.show();
      return app.exec();
      }

      Attachments

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

        Activity

          People

            pullatti Prasanth Ullattil
            poulain Benjamin Poulain (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes