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

4.7/Cocoa: QActions attached to menu bar do not always get dispatched (test case attached)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.7.2
    • 4.7.0
    • None
    • Mac OS 10.6.4. Qt 4.7.0/Cocoa. Qt 4.6.3/Carbon.
    • 3fddf68f376fe06d0af3f390a94ed84cc1a3fa38

      On the Mac it is possible to have an application with no windows open. In this case, menus can be attached to a subclass of QApplication.

      Furthermore, it is possible to build menus "on the fly" by using the 'aboutToShow' signal of QMenu.

      Unfortunately, menus that are built "on the fly" and attached to QApplication are not dispatched when there are no windows open. This bug makes it impossible for any dynamically "on the fly" menu to be used at the application level. Such an example would be a 'recent documents' menu item.

      I've attached an example to demonstrate this problem. Run the example. The example creates a menu with two items: one static item; and one dynamic item.

      Choose the menu item test > action and then test > action2. Both of these will print out their title in the console.

      Next, close the window. Now choose the same menu items again. Now the non-dynamic one will print its action; but the dynamic one will not. This is the bug.

      This test application works under 4.6.3/Carbon; it fails with 4.7.0/Cocoa.

      The following bug may be related to this problem too:
      http://bugreports.qt.nokia.com/browse/QTBUG-13898

        1. MenuBug.zip
          2 kB
          Chris Meyer
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            andysh Andy Shaw
            cmeyer Chris Meyer
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes