Important: Please read the Qt Code of Conduct -

QSS validation - XML document contains QSS snippets and validating the QSS in the specialised tool users have for editing the XML document would be gr

  • Qt tools have QSS validation - anyone know how I can get hold of that functionality without the gui? I need something I can pass a snippet of QSS to which returns true or false (valid or not)

  • If you don't mind some manual work, just open the Qt Creator's Designer, select any widget, look for the "stylesheet" property in the property editor, click on the three dots and paste your qss into the textarea there. It will immediately tell you whether it is valid or not.

    In case of an error, It does not show you the invalid line, so I usually just do a binary search removing parts of the qss code until it validates :o)

    Anyway the code for validating qss files has to be in the Qt Creator's source code, so you can look there if you need it.

Log in to reply