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. can I trap click event on a disabled button?

can I trap click event on a disabled button?

Scheduled Pinned Locked Moved General and Desktop
qpushbuttondisableclickevent
3 Posts 2 Posters 1.7k Views
  • 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.
  • P Offline
    P Offline
    pmh4514
    wrote on last edited by
    #1

    My GUI is a complex control interface for external hardware and there are times where the state of the hardware, or certain user selections as it relates to the state of the hardware, dictate that certain controls and GUI options be disabled. I thought it might be nice to pop-up some informative text explaining why a particular control is disabled if the user tries to click it while it is disabled. Can I trap for click-event even if the button is disabled?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Not exactly what you're asking for, but you could set the button's tooltip to display the text explaining why it's disabled when they hover over the button. Clear the tooltip text when you re-enable the button.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pmh4514
        wrote on last edited by
        #3

        Ahh hadn't thought of that. I didn't realize tooltips would activate either on a disabled control. I'll give it a try.

        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