Some posts (namely, these two: Set CSS in QPushButton's subclass's constructor and Does the use of styleSheets in a dynamic manner add a lot of computation) suggest that I should use a single qss file for my Qt application.
However, imagine I have a QLabel
subclass whose purpose is (using stylesheets) to provide a particular look/behavior (say BlinkingLabel
, however horrendous it would look). In that case, doesn't it make sense to prepare a separate stylesheet and load it in the class constructor? Wouldn't using a global file take away a very useful aspect of using OOP for UI components? Because if I do so, I can no longer just take the class and put it in another project without worrying about anything, because it can take care of itself; I have to remember to copy the relevant stylesheet entries.