[Qt-interest] How to set textcolor for actions in QMenu?

Konrad Rosenbaum konrad at silmor.de
Mon May 9 11:15:14 CEST 2011


On Monday 09 May 2011 08:21:00 Wilhelm wrote:
> I suppose this is a very simple question, but how do I set the textcolor
> of the actions in a QMenu to different colors: say the first show be
> black (normal), the next red, etc.

You can't. Unless you write your own custom QMenu class.

Menus are highly platform dependent, so Qt does the adaptations of what to 
show and how - you just set the state (checkable, checked, enabled, etc.).

Why would you want to have colored menu entries anyway? Usually there is a 
better way of doing this.


	Konrad

PS.: please remove the "Reply-To" configuration from your mail program. It is 
unnecessary since your From and Reply-To are identical. It just confuses the 
mail program of receivers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110509/8b08d4b0/attachment.bin 


More information about the Qt-interest-old mailing list