qt - Set an Icon in QMenu with Stylesheet? -


how can set icon qaction in qmenu through stylesheet?

for example:

qmenu* menu = new qmenu();  qaction* action1= new qaction(); qaction* action2= new qaction();  menu->addaction(action1); menu->addaction(action2); 

now want set different icon action1 , action2 qt stylesheet.

is possible stylesheet?

stylesheets apply widgets.

qt style sheets powerful mechanism allows customize appearance of widgets, in addition possible subclassing qstyle.

qaction not widget, can't add icon qaction via style sheets. however, have shot qactionwidget , example qlabel, if can tricky.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -