Skip to content

qsslint – A linter for Qt stylesheets

Enter the wonderful world of tools for which the announcement blog takes more time to write than the tool itself.

qsslint is a small command-line utility for verifying the syntax of your Qt stylesheet files (*.qss). It’s much like KDAB’s previous linter contribution, qmllint. It simply returns 0 if the stylesheet is valid, and non-zero otherwise.

Don’t get me wrong, I do dislike CSS and don’t want to encourage its use. But if you can’t run away from it, then at least use a linter to catch errors at compile time rather than production.

The suggested way to use these tools in your day-to-day is: you don’t. Instead, incorporate them into your build system or CI and forget about them until a developer makes a typo.

Furthermore, use the same advice for each different source file-type. Be it XML, JSON or QML, there are plenty of linters available. And finally, for C++, the compiler already checks the syntax for you, but now you can also verify Qt semantics by using clazy, or get advanced C++ diagnostics with clang-tidy.

So, what else should we do at build time ? Suggestions welcome. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.