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. Changing button color doesn't work !
QtWS25 Last Chance

Changing button color doesn't work !

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 253 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.
  • F Offline
    F Offline
    fres
    wrote on last edited by fres
    #1

    When I change the color of the Button "OK", it doesn't work
    imane.png

    This is what happen:
    imane1.png

    I don't even see the button "OK", so I want to change the button color in white, but it doesn't work when i write this :
    msgBox.setStyleSheet("background : solid black; QMessageBox QPushButton{color: white; }");

    1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #2

      @fres try setting like this
      msgBox.setStyleSheet("QDialog{background-color:black;}QPushButton{background-color:white;}");

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fres
        wrote on last edited by
        #3

        Thanks it works!

        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