I think my appication doesn't have a good architecture. I can't figure out how to navigate between files correctly.
Here is a non-standardized schema of my application.
Each file contains one class.
The principal problem is that I can't get some variables from any class to another because of the architecture of the code.
If I put all my classes in one file, it will certainly runs but I want to separate all my classes (which are QWindow
and QWidget
) in several files.
1. In every parent class, import each child with :
For example, in the optionwindow class, you will have :
Note 1 : For better lisibility, name your files with the same name as your classes. *for example : mytoolbar.py contains
class mytoolbar(QtGui.QToolBar)*
Note 2 : You need to place an empty __init__.py in every folder that contains a class)
Note 3 : You can place classes in different folders. If you do so, use :
2. To instantiate and call child functions or get child variables :
In the parent class :
In the child class :
3. To get parent or grand-parents variables or functions in child : In the parent class :
In the child class :
Note : self.parent().parent(). ... will get you to the grand parent.
I hope it helped