Structuring a Large PyQt Application

I am an NVH Engineer and I am learning Python. Historically I have used Labview and other commercial software in my work life. I like that there is so much work that has been done developing code for NVH analysis in python.

I would like to make open-source GUI applications that can harness a lot of the work that has been done. The first thing I want to tackle is a Time Data Recorder application. functionally it would operate similarly to this commercial product.

HDF5 - Data Storage
pyacq - Possible acquisition framework
GUI - Develop in PySide2

I was thinking about something like this for gui skeleton

and this for the TDR App inside it

I am looking for some help with directory and software structure. I have the main layout working in code (buttons don’t do anything yet). Any thought would be helpful

Timm

Hi tcarson4344

Indeed, it is a large PyQt application that you plan to design. :wink:

Personally, I can give a part of answer because, even I have planned to make a big (for me) application in another domain than you, I have studied a bit the question.

On the left part, you’ll need a QListWidget and on the right part a QStackedWidget and probably a QStackedLayout. This latter is not sure. A bit like this.

About the structure, usually I used this one: (after it is done for Linux only) I don’t know for Macos and Windwos.

For the root package (i.e the folder of the application herself), I introduce a start_app file (which run the application) and share files in different folders according to their membership ui, translations, window etc …

This thread on Stackoverflow will be helpful for you. You have even a project structure proposed.

I hope that will help you.

1 Like

@Eolinwen,

Thank you this is helpful.
Does something like this seem reasonable?

β”œβ”€β”€ main.py
β”œβ”€β”€ ui_main.py
β”œβ”€β”€ Modules
β”‚   β”œβ”€β”€ Time_Data_Recorder
β”‚   β”‚   β”œβ”€β”€ TDR.py
β”‚   β”‚   β”œβ”€β”€ ui_TDR.py
β”‚   β”œβ”€β”€ Spectral_Testing
β”‚   └── Other_Modules
└── Third_Party_libraries
    β”œβ”€β”€ HDF5
    β”œβ”€β”€ Pyacq
    β”œβ”€β”€ Plotting
    └── Other

Hum. Like it is a large App, and with the result that you want, I 'll create a sub-folder (like Modules folder) for ui files at least. You should cut your code if you don’t want to be overflow. And if you add views…

I suggest that you 'll take a look at the structure of Openshot-qt. Even it is not in the same domain, it is a large project (Video Editor) and with the Stackoverflow structure they will correspond more at that you want to get.

And use uic for loading ui files…but be careful for memory foot.

1 Like