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

Windows/Vista Style: QMenu text color is not correctly set by stylesheet

    XMLWordPrintable

Details

    • b152b425f74788b2f2845fb7d1a5032d86b8746d (dev, 22.1.2014, 5.3) 40db54f8182e427f76c663aec15c3a6a682b3c9f (4.8.6, 23.1.2014)

    Description

      QMenu items action text is staying default black when changing it by stylesheet. Shortcut text color is still changed.

      main.cpp
      #include <QApplication>
      #include <QMenu>
      #include <QCursor>
      
      class Widget : public QWidget
      {
          void mousePressEvent( QMouseEvent * event )
          {
              QMenu *menu = new QMenu();
              menu->setStyleSheet("QMenu{color: red;}");
              menu->addAction("Cut",0,0,QKeySequence::Cut);
              menu->addAction("Copy",0,0,QKeySequence::Copy);
              menu->addAction("Paste",0,0,QKeySequence::Paste);
              menu->exec(QCursor::pos());
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          Widget w;
          w.show();
          return a.exec();
      }
      

      All text color was changed correctly on Mac OS

      Attachments

        1. qtbug36142_diag.patch
          10 kB
          Friedemann Kleint
        2. qtbug36142.log
          1.0 kB
          Friedemann Kleint
        3. qtbug36142.ui
          2 kB
          Friedemann Kleint
        4. qtbug36142.zip
          1 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes