Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved What is the exact code to change PushButton background-color onclick in the button's stylesheet in Qt Designer?

    General and Desktop
    pushbutton qt designer stylesheet pyqt5 python3
    2
    3
    274
    Loading More Posts
    • 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.
    • I
      I-TECH last edited by

      How to make the PushButton's background-color gets changed onClick and onHover by adding code directly in button's stylesheet in Qt Designer. I spent hours googling but found nothing working. Thank you very much.

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @I-TECH last edited by

        @I-TECH
        This requires writing code to change the stylesheet in a slot. In Designer you can get as far as connecting signals to slots, but you can't write the code of a slot. So as far as I know you cannot do this 100% from Designer alone.

        I 1 Reply Last reply Reply Quote 2
        • I
          I-TECH @JonB last edited by

          @JonB Thank you for interactions. Would you please show me an exact code of for example a PushButton and where to implement it. I am advanced python coder, I just need to see exact steps. Thank you very much.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post