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

Crash if the Menu Bar ends with an invisible action and a user tries to pass it to the menu's beginning

    XMLWordPrintable

Details

    • 8ea60a39a8c4661db505a6dc1342e524ec2e460c

    Description

      How to reproduce:

      1. Build and run the following program

      main.cpp
      #include <QtGui/QApplication>
      #include <QtGui/QMenuBar>
      #include <QtGui/QAction>
      
      int main( int argc, char *argv[] )
      {
          QApplication app( argc, argv );
          QMenuBar mb;
          QMenu   * m = mb.addMenu  ( "&m" );
          QAction * a = mb.addAction( "&a" );
          a->setVisible( false );
          mb.show();
          return app.exec();
      }

      2. Activate its "m" menu item and press Right.

      In the debug build, there's an assert:

      Windows assert message box
      ---------------------------
      Microsoft Visual C++ Debug Library
      ---------------------------
      Debug Error!
      
      Program: ...\debug\main.exe
      Module: 4.6.2
      File: global\qglobal.cpp
      Line: 2230
      
      ASSERT failure in QList<T>::at: "index out of range", file ...\qt-everywhere-opensource-src-4.6.2\include\qtcore\../../src/corelib/tools/qlist.h, line 439
      
      (Press Retry to debug the application)
      ---------------------------
      Abort   Retry   Ignore   
      ---------------------------
      

      The real-life, release-built application crashes immediately.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            hart Khamidullin, Ruslan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes