QT5_By_Example Design - russ-hensel/qt5_by_example GitHub Wiki
This application has grown from a small bit of code to something bigger. You can use this code as part of What We Know about QT, but that is mostly intended for the code in the tabs.
However you may want to know a bit about what is done in the code that supports the tabs.
The main application is in https://github.com/russ-hensel/qt5_by_example/blob/main/qt5_by_example.py which sets up an application and its main window]] and of course it calls on other modules and objects to build the rest of the applications.
The tabs are tracked and built by scanning directories for files/modules that hold tabs. They are then entered into a sqlite db which is then hooked up to to the user interface.
Each tab is created from a base tab qt5_by_example/tab_base.py at main · russ-hensel/qt5_by_example https://github.com/russ-hensel/qt5_by_example/blob/main/tab_base.py which has some of the infrastructure to support the example tabs.
For the sql widgets there is a second sqlite db. This DB is created from scratch each time the application is started, so you always start from the same state.
All but the first 2 tabs which are part of the infrastructre of the app can be created and destroyed at will. Re-creating a tab will always start it from the same state.
The is an application for command line examination of state called wat-inspector. I have incorporated a gui into this application and make it available on each tab under the wat inspect button.
The breakpoint-debug button is implemented by a breakpoint() call in each tab, this drops you off in the debugger in the code that the button belongs to.
You are intened to run this app in an IDE, and in part because of this I do not follow conventional rules on environments, paths.... To deal with some aspects of this we run the module qt5_by_example/adjust_path.py at main · russ-hensel/qt5_by_example https://github.com/russ-hensel/qt5_by_example/blob/main/adjust_path.py that makes sure the imports all work.
Additionaly any directory where a tab may be ( see in parmaters.dir_for_tabs qt5_by_example/parameters.py at main · russ-hensel/qt5_by_example https://github.com/russ-hensel/qt5_by_example/blob/main/parameters.py ) is also added to the application path.
The overall design of the application has be a process of explotory growth so there are aspects of a "big ball of mud" in the design. Bit by bit it is being refactored but sorry to say there is a lot of kruft and dead code. This will get better.