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

[Reg 6.4->6.5] QMenu no longer renders disabled text correctly

XMLWordPrintable

    • Windows
    • 491534006 (dev), c8c3c4406 (6.6), 218d7a9c2 (6.5)

      Code

      #include <QtWidgets>
      
      int main(int argc, char** argv)
      {
          QApplication app(argc, argv);
          QMainWindow w;
      
          auto menu_e = w.menuBar()->addMenu("Enabled Menu");
          w.menuBar()->addMenu("Disabled Menu")->setDisabled(true);
      
          QIcon icon(":/qt_logo.png");
          menu_e->addAction(icon, "Enabled");
          menu_e->addAction(icon, "Disabled")->setDisabled(true);
      
          w.resize(300, 150);
          w.show();
      
          return app.exec();
      }
      

       

      Expected outcomes (Qt 6.4.3 and older)
      Disabled menu items have their icons and text greyed out

       

      Actual outcomes
      Disabled menu items have their icons greyed out, but their text look "enabled"

        1. menus-bad.png
          6 kB
          Sze Howe Koh
        2. menus-good.png
          7 kB
          Sze Howe Koh
        3. qtbug-114821.zip
          4 kB
          Sze Howe Koh
        4. screenshot-1.png
          17 kB
          Axel Spoerl
        5. Notepad++.png
          16 kB
          Breanna Ammons
        6. Paint.png
          15 kB
          Breanna Ammons
        7. Notepad_dark.png
          13 kB
          Breanna Ammons
        8. Notepad_light.png
          13 kB
          Breanna Ammons
        For Gerrit Dashboard: QTBUG-114821
        # Subject Branch Project Status CR V

            santhoshkumar Santhosh Kumar Selvaraj
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes