[Interest] Qt5 CSS StyleSheet Variables

Michael Jackson mike.jackson at bluequartz.net
Mon May 21 19:29:01 CEST 2018


This was the route I was in the process of designing up with a combination of JSON to store the values that we want to allow users to change. 

Thank you for the verification of the process.

Mike Jackson

-----Original Message-----
From: Interest <interest-bounces+mike.jackson=bluequartz.net at qt-project.org> on behalf of Tony Rietwyk <tony at rightsoft.com.au>
Date: Monday, May 21, 2018 at 11:44 AM
To: <interest at qt-project.org>
Subject: Re: [Interest] Qt5 CSS StyleSheet Variables

    Hi Mike,
    
    QStyleSheets are pretty limited, so we:
    
    - load a sass file from Qt resources,
    
    - inject some calculated variables at the start relating to the specific 
    app and client screen size,
    
    - process the sass to css
    
    - set the output into QApplication.
    
    This occurs at startup, and whenever the screen changes.
    
    Hope that helps, Tony
    
    
    On 22/05/2018 1:17 AM, Christian Ehrlicher wrote:
    > Am 21.05.2018 um 15:47 schrieb Michael Jackson:
    >> Just to confirm, but does Qt accept CSS variables as describe here: 
    >> <https://www.w3schools.com/css/css3_variables.asp> ?
    >>
    >> I tried and I get the error that the style sheet could not be parsed. 
    >> I have a style sheet with a LOT of color settings and having to do a 
    >> bunch of search/replace to change the colors is error prone at best.
    >>
    > http://doc.qt.io/qt-5/stylesheet-reference.html should be your reference.
    >
    > Christian
    
    _______________________________________________
    Interest mailing list
    Interest at qt-project.org
    http://lists.qt-project.org/mailman/listinfo/interest
    





More information about the Interest mailing list