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
QtWS25 Last Chance

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 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?

    mrjjM 1 Reply Last reply
    0
    • M melevine

      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?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #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

      • Login

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