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. Use LESS or similar to generate a Qt Stylesheet

Use LESS or similar to generate a Qt Stylesheet

Scheduled Pinned Locked Moved General and Desktop
cssqss
2 Posts 2 Posters 2.1k Views
  • 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.
  • M Offline
    M Offline
    melevine
    wrote on 10 Aug 2015, 20:15 last edited by
    #1

    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?

    M 1 Reply Last reply 10 Aug 2015, 22:24
    0
    • M melevine
      10 Aug 2015, 20:15

      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?

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 10 Aug 2015, 22:24 last edited by mrjj 8 Oct 2015, 22:25
      #2

      @melevine

      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.html

      As 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

      1 Reply Last reply
      0

      2/2

      10 Aug 2015, 22:24

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved