Use LESS or similar to generate a Qt Stylesheet
-
I'm creating a stylesheet for my Qt application to customize the look and feel. I'd love to take advantage of a CSS generator like LESS or Compass, so I can at least use variables for color and perhaps take advantage of some of the other cool features they offer.
Is this even possible? Are Less and Compass able to generate valid Qt stylesheets?
-
Hi and welcome
Since the parser of QSS knows nothing of CSS from LESS / Compass, it can not be used directly.
http://doc.qt.io/qt-4.8/stylesheet-syntax.htmlAs far as I can see both uses css/extended css and knows nothing of Qt.
So I guess its a no. sadly.
But you can somewhat easy use "variables" for colors if you hax it a bit you self
http://stackoverflow.com/questions/10898399/using-variables-in-qt-stylesheets
by writing some code to do some string replacements.
https://forum.qt.io/topic/17318/solved-using-variables-in-style-sheets-qss/2