Results 1 to 9 of 9

Thread: Checkable Action Icon

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Checkable Action Icon

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Checkable Action Icon

    Take a look at style sheets.
    J-P Nurmi

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Checkable Action Icon

    Oh thanks, I guess I missed it.

  4. #4
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Checkable Action Icon

    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?

  5. #5
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Checkable Action Icon

    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.

  6. #6
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Checkable Action Icon

    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.

  7. #7
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Checkable Action Icon

    Hi again,

    I solved my problem. Thanks

  8. #8
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Checkable Action Icon

    So, how did you do it?

  9. #9
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Checkable Action Icon

    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.

Similar Threads

  1. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  2. QTreeView default drag action
    By onamatic in forum Qt Programming
    Replies: 2
    Last Post: 1st March 2010, 07:37
  3. Replies: 12
    Last Post: 21st November 2008, 04:42
  4. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23
  5. Missing action icons
    By ReilenBlaeyze in forum KDE Forum
    Replies: 4
    Last Post: 20th February 2006, 12:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.