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

REG [4.8.? -> 4.8.6] Menus with lots of actions don't wrap correctly on Windows (Vista Style)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.x
    • 4.8.6, 5.3.0 Alpha
    • None
    • Windows 7
    • Qt 4: db01f4ac1fd7bdcd6bc165971481c00d1d0141d0 (23.4.2014, 4.8.7)

    Description

      On Windows, if I create a QMenu and add enough QActions to it such that the number of QActions cannot fit within the height of the screen when the menu is displayed, the menu is supposed to get extra columns as necessary to display all of the actions.

      This behavior is broken in 4.8.6 and 5.3-rc1. The menu gets extra columns but the text of the actions is not displayed in the additional columns. See attached screenshot and example project you can use to reproduce the problem. I have highlighted the areas of the screenshot that are missing the actions.

      I know this worked correctly in previous versions of Qt--probably 4.8.5, though I no longer have copy of 4.8.5 available on my machine to test.

      The code in the attached experiment is simply:

      #include <QApplication>
      #include <QToolButton>
      #include <QMenu>
      
      
      int main(int argc, char *argv[])
      {
      	QApplication a(argc, argv);
      	QWidget w;
      	QToolButton* tb = new QToolButton(&w);
      	tb->setPopupMode(QToolButton::MenuButtonPopup);
      	QMenu* theMenu = new QMenu(&w);
      	for (int n = 0; n < 100; n++) {
      		theMenu->addAction(QString::fromLatin1("item%1").arg(n));
      	}
      	tb->setMenu(theMenu);
      	w.show();
      
      	return a.exec();
      }
      

      Attachments

        1. QMenuLotsOfActions.png
          22 kB
          Adam Light
        2. qtbug38376_diag4.patch
          2 kB
          Friedemann Kleint
        3. qtbug38376.zip
          2 kB
          Friedemann Kleint
        4. test.zip
          0.7 kB
          Adam Light

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              aclight Adam Light
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes