Qt compilation and stylesheet

Posted by Yosko on Stack Overflow See other posts from Stack Overflow or by Yosko
Published on 2012-09-07T15:38:04Z Indexed on 2012/09/10 9:38 UTC
Read the original article Hit count: 240

Each time I compile my Qt project after modifying my qss stylesheet file, the modifications aren't taken into account, unless I rebuild everything.

Any idea on a workaround for this, so that I don't have to wait 5 minutes each time I change my qss ?

Notes: I use Qt 4.8, and my stylsheet is declared in a resource file (qrc).

EDIT: As suggested by Luca Carlon, when a qss is reference in the project through a .qrc file, the changes in the qss don't affect the qrc, and the compiler ignores it. To avoid that, I added a Custom Build Step to my project:

  • before the qmake step!
  • calls a .bat file without any argument
  • the .bat contains the real command copy /b files.qrc +,,

© Stack Overflow or respective owner

Related posts about qt

Related posts about custom-build-step