PDA

View Full Version : Checkable Action Icon



zgulser
13th January 2009, 06:43
Hi everybody,

I have some menu actions which are checkable. I want to change the icon that appears near the at the left-near of the action when the action is checked. Is this possible? If it is, how?

Regards.

jpn
13th January 2009, 09:00
Take a look at style sheets.

zgulser
13th January 2009, 11:24
Oh thanks, I guess I missed it.

zgulser
13th January 2009, 14:16
Hi again,

I found what you posted but I want to change the ""checked icon". I couldn't do it from here. Can you give more tips?

rexi
13th January 2009, 19:28
So, as I understand you want to change the checkmark graphics? I haven't used stylesheets before, but from the documentation I understand that QMenu::indicator is probably what you are looking for.

zgulser
13th January 2009, 22:42
Briefly;

First of all, I'm using motif style as the window style. It may be useful to say this before.

When I click the checkable property of a menu action, it puts an empty box near the action description and as you guess, when you select this action as the application is running, the box near the actions in filled or checked.

What I exactly want is to remove this box entirely and put my own icon whenever an action is selected from any menus stay at the menubar. But I couldn't do this yet.

By the way, I tried ::icon:checked{ image: url(foo.png)} but it didn't work.

zgulser
14th January 2009, 09:25
Hi again,

I solved my problem. Thanks

rexi
14th January 2009, 18:28
So, how did you do it?

zgulser
15th January 2009, 13:13
use indicator sub-control from the designer style sheet( you know you can use style sheet from the source which I dislike). If you can't, please let me know.