I do a desktop application on python3 + pyqt5, which consists of several components:
- menu /
- menu.py
- menu.ui
- main /
- main.py
- main.ui
- app /
- app.py
- app.ui
default /
- default.py
- default.ui
I need to implement switching between the mappings of different components in one window. Those. there is a main window divided horizontally into two parts by two widgets and you need to display the menu taken from menu / menu.py in the upper widget, and the contents of the widget from default / default.py in the lower widget when the program is turned on click on the button in the menu on app / app.py.
I do not convert .ui files to .py and work with them like this:
uic.loadUi("main/main.ui", self) self.hello_button.clicked.connect(self.print_text)
Please tell me what classes, methods of pyqt5 can insert and change the contents of widgets in the main window from the widgets of other program components.
I tried various ways with hide () and show (), but this does not solve this problem. I studied the documentation, but a huge number of classes are confusing when looking for the right solution, plus this documentation for c ++ and, as a beginner, it’s quite difficult for me to understand it as quickly as, for example, python documentation.
Thank you in advance for all the answers.