Sure. But I was referring to what I usually do, and which could sometimes
be problematic and where it looks like your qtpaths solves it (I think):

I set the parent from within a subclass with a parent like

self.mainName = parent

And then if this subclass is inherited I may set

self.mainName.subclassName = parent

And so on… and then I would make sure I can access these object names
throughout my app. So from any class, I can access
self.mainName.subclassName.widgetName

But in the case of e.g. an image viewer which loads the same widget *n*
times (e.g. one per image), you can’t hard code names like that. That’s
where I thought your solution seemed nice, cause then you could serialize
on window or maybe parent widget.

On a slightly different note… if you load ui files into PySide vs PyQt the
recommended ways of doing it – PySide/QUiLoader vs PyQt/uic.loadUi – this
results in different ways of fetching the ui widgets. I solved this with by
using PySide/pysideuic vs PyQT/uic, as shown in this boilerplate:
https://github.com/fredrikaverpil/pyVFX-boilerplate
I wrote more about that in detail here:
https://github.com/fredrikaverpil/pyVFX-boilerplate/wiki#why-pysideuic
Not sure if that is at all related to what you're doing but maybe worth
taking into account.

// Fredrik



 Thanks Fredrik, I’ve also felt the need for something like this.
> Especially for debugging and CSS.
>
> But this could of course sometimes become problematic if a class can have
> different parents.
>
> Could you elaborate on this?
> ​
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWOdn%2BAXuffvp3MX49YfCEwfuaoDVCNm_pNRH3y4LPCn9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to