Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAction Disabled in a Toolbar can not be Checked?
Forum Updated to NodeBB v4.3 + New Features

QAction Disabled in a Toolbar can not be Checked?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ycyclop
    wrote on last edited by
    #1

    I added a QAction to a toolbar through a QToolbutton.

    Setting the action as checkable enabled me to set it as checked and everything worked great until I wanted to marked it as checked and disabled.
    At this point the action was indeed marked as disabled but the checked indication was removed. It looked as if the button is flat. can the checkable state be shown only when the action is enabled?

    Thank you for any ideas

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      It is actually shown as both checked and disabled, but the only difference is that the contents of the button has been slightly shifted. That is too subtle to notice.

      There are two ways around it, and both have disadvantages:

      create a proxy style to render the button differently in this case.

      use a style sheet do define your own styling.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved