Important: Please read the Qt Code of Conduct -

[SOLVED]Stylesheets changing

  • In qt it's very easy to set the stylesheet to the ex. Buttons but if I want to change the color on a click or so the color changes but also my style of the button changes.
    Is there an easy way to do this in a global function because I want all of my buttons to look in the same way but the colors could be diffrent.

    This is how my buttons looks like today in code
    alternate-background-color: rgb(0, 170, 0);
    background-color: rgb(255, 85, 127);
    border-width: 6px;
    border-radius: 10px;
    background-color: rgb(235, 230, 230);
    border-color: beige;
    font: bold 14px;
    min-width: 5em;
    padding: 6px;
    It's done in the stylesheetpopup.
    Could I somehow set up a Identical code but with another color as a alternating button look and call it from my code.


Log in to reply