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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -