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
          menus-bad.png
          6 kB
        2. menus-good.png
          menus-good.png
          7 kB
        3. qtbug-114821.zip
          4 kB
        4. screenshot-1.png
          screenshot-1.png
          17 kB
        5. Notepad++.png
          Notepad++.png
          16 kB
        6. Paint.png
          Paint.png
          15 kB
        7. Notepad_dark.png
          Notepad_dark.png
          13 kB
        8. Notepad_light.png
          Notepad_light.png
          13 kB
        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