Search code examples
qtstylesheet

How to create a QPushButtton with 2 borders using style sheets?


I'm trying to use style sheets to customize a QPushButton. Using the following style sheet I have create a button with a gray background and a black boarder around it :

 background-color: rgb(97, 97, 97); 
 border-style: outset;
 border-width: 1px;
 border-color: rgb(0, 0, 0);
 border-radius: 4px;
 color:rgb(255, 255, 255);

I'd like to add a second border around the button using the style sheet. I tried setting a padding color, but that does not seem to do anything. Is it possible to add a second border?


Solution

  • If you would like to use only style sheet it's probably not possible.

    Similar solution is to change border-style to double, e.g.

    background-color: rgb(97, 97, 97);
    border-style: double;
    border-width: 3px;
    border-color: rgb(0, 0, 0);
    border-radius: 4px;
    color:rgb(255, 255, 255);
    

    All available borders.

    Relating to padding it's not possible to set a color for it. Explain how it look is here.