@JonB said in accessing several .ui files in python:
You sound like you are doing Option B: Loading it directly. If you do this you will not be able to access all your widgets so easily. I would always recommend the alternative, Option A: Generating a Python class. It's a touch more work --- you have to run a pyside6-uic tool step to produce Python code from the .ui in a generated .py file (I think Creator can run this for you each time) --- but in return you get proper coding-time support for all your widgets.
An interesting thing I've noticed lately:
We had a similar topic in the German section where OP used the QUiLoader/"direct" approach, but then struggled with (as you also mentioned) accessing and connecting the child- and sub-Widgets from the UI-based QWidget constructed by QUiLoader.
I've also recommended using the uic tool to convert the .ui to a .py class, esp. when you are a beginner.
However, I was told that at some other place (Python forum) OP read about "the Python community" condemning this "generator" approach, since it violates some principles of interpreted languages... :D
Yeah, sure... :D
I'm not a Python-hater, or a Python-fanboy, but without already popular frameworks providing Python-bindings, nobody would use Python in these cases... the whole community profits. So you might have to accept it's downsides, which come with the fact that these frameworks weren't intented for Python-like languages and are only usable through bindings.
Try to write your own platform independent, holistic GUI framework like Qt from scratch using Python only... Good luck with that ;-)