Import a UI schema in PySide


I have a PyQt StyleSheet scheme in a separate document that I want to import into a UI.

I'm doing the following:

style_sheet_file = qc.QFile(os.path.join(os.path.dirname(__file__), 'stylesheets', 'scheme.qss'))

However, I receive the following error in PySide:


AttributeError: 'module' object has no attribute 'QLatin1String'

What other alternatives could you use to do such an action?

I tried:

#style_sheet_file = mc.internalVar(usd=1) + 'digital_tutors\stylesheets\'

and it runs me without error, but I do not care about the file inside the UI. That is, it is as if setSyleSheet was empty.

asked by Nestor Colt 17.07.2017 в 14:18

1 answer

   style_sheet_file = mc.internalVar(usd=1) + 'digital_tutors\stylesheets\scheme.txt'
    with open(style_sheet_file,'r') as styleSheet:
        data = str(

That's how I solved my problem.

answered by 17.07.2017 в 14:55