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. What is the exact code to change PushButton background-color onclick in the button's stylesheet in Qt Designer?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
pushbuttonqt designerstylesheetpyqt5python3
3 Posts 2 Posters 705 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.
  • I Offline
    I Offline
    I-TECH
    wrote on 31 Jan 2021, 23:10 last edited by
    #1

    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.

    J 1 Reply Last reply 31 Jan 2021, 23:40
    0
    • I I-TECH
      31 Jan 2021, 23:10

      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.

      J Offline
      J Offline
      JonB
      wrote on 31 Jan 2021, 23:40 last edited by
      #2

      @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 1 Feb 2021, 22:29
      2
      • J JonB
        31 Jan 2021, 23:40

        @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 Offline
        I Offline
        I-TECH
        wrote on 1 Feb 2021, 22:29 last edited by
        #3

        @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
        0

        3/3

        1 Feb 2021, 22:29

        • Login

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