I have 3 ui files. I want to make 3 classes to load file MainWindow.ui and input widget1.ui and widget2.ui into MainWindow, and. So we just have one main window and in it 2 widgets that can communicate with each other. Also, an additional feature: how can we write a function in such a way that it listens to incoming data and then sends it away?
MainWindow
widget1
widget2
the result I want is
MainWindow.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>682</width>
<height>391</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>280</x>
<y>35</y>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Main Window</string>
</property>
</widget>
<widget class="QWidget" name="widget1" native="true">
<property name="geometry">
<rect>
<x>25</x>
<y>95</y>
<width>286</width>
<height>216</height>
</rect>
</property>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>75</x>
<y>60</y>
<width>47</width>
<height>13</height>
</rect>
</property>
<property name="text">
<string>Widget1</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>365</x>
<y>80</y>
<width>251</width>
<height>236</height>
</rect>
</property>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>60</x>
<y>80</y>
<width>47</width>
<height>13</height>
</rect>
</property>
<property name="text">
<string>Widget2</string>
</property>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>682</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
widget1.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>170</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>4</x>
<y>20</y>
<width>391</width>
<height>106</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Mychoice</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox"/>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
widget2.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>229</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>25</y>
<width>326</width>
<height>192</height>
</rect>
</property>
<row>
<property name="text">
<string>apple</string>
</property>
</row>
<row>
<property name="text">
<string>mango</string>
</property>
</row>
<column>
<property name="text">
<string>New Column</string>
</property>
</column>
<column>
<property name="text">
<string>number</string>
</property>
</column>
</widget>
</widget>
<resources/>
<connections/>
</ui>



