Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Application color scheme



  • Hello!!

    I am developing an application in which I want to have a color scheme system. The user could select the color scheme and the application must change between, for example, reds to greens or something like that.

    How could I do it?

    Thank you very much!


  • Lifetime Qt Champion

    Hi
    but do you already use stylesheets so you can change colors ?

    Also what about any icons etc ?



  • @mrjj Yes, I use stylesheets but my question is if there is a way to make it more automatic and not have to change every .css file manually. I think in android, for examplo, you can set a color palette


  • Lifetime Qt Champion

    @ivanicy

    Hi
    Not that I have seen as you can't really use named colors in the css, nor does the QStyle on each platform
    always honor the palette.

    you never have to manually change the .css

    auto style_sheet = QString("border: 1px solid green;"
    "background-color: #%1;") .arg(QPalette().color(QPalette::Base).rgba(), 0, 16);

    but you will have to make it possible for code to change them.


Log in to reply