0

I'm trying to set different text colors for my QActions inside a QMenu. For example File -> Open -> Save

And I want to have Open written in red and Save in blue. I tried modifying the style of the File menu but this doesn't work, all the QActions of the given menu will end up having the color specified for the last QAction.

Is there any simple way of doing it that I'm missing here ?

EDIT: The solution suggested here doesn't work for me. Since I'm populating my QMenu with for loop, the last iteration will set a stylesheet to the menu and all the QActions will have this stylesheet. I guess it overwrites the stylesheets set previously.

nmud
  • 175
  • 14
  • 2
    Possible duplicate of [QMenu: Set text color for specific QAction](https://stackoverflow.com/questions/29939522/qmenu-set-text-color-for-specific-qaction) – eyllanesc Feb 20 '18 at 18:13
  • I edited my question. I had tried the post you suggest but it didn't work for me and I forgot to mention it first – nmud Feb 21 '18 at 08:46

0 Answers0