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. [SOLVED]Stylesheets changing

[SOLVED]Stylesheets changing

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    toho71
    wrote on last edited by
    #1

    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
    @QPushButton{
    alternate-background-color: rgb(0, 170, 0);
    background-color: rgb(255, 85, 127);
    border-style:outset;
    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.

    //Thomas

    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