@Santosh Reddy below is a sample ui.

@ChrisW67 .. I do have a layout for the group-box, as I mentioned in my description the group-box has a grid layout.

by main problem is that the widget in the designer is not the same when i run it.

//mainwindow.ui
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ui version="4.0">
  3. <class>MainWindow</class>
  4. <widget class="QMainWindow" name="MainWindow">
  5. <property name="geometry">
  6. <rect>
  7. <x>0</x>
  8. <y>0</y>
  9. <width>498</width>
  10. <height>523</height>
  11. </rect>
  12. </property>
  13. <property name="windowTitle">
  14. <string>MainWindow</string>
  15. </property>
  16. <widget class="QWidget" name="centralWidget">
  17. <layout class="QGridLayout" name="gridLayout">
  18. <item row="1" column="0">
  19. <widget class="QTabWidget" name="tabWidget">
  20. <property name="currentIndex">
  21. <number>0</number>
  22. </property>
  23. <widget class="QWidget" name="tab">
  24. <attribute name="title">
  25. <string>Tab 1</string>
  26. </attribute>
  27. <layout class="QGridLayout" name="gridLayout_11">
  28. <item row="0" column="0">
  29. <widget class="QGroupBox" name="groupBox">
  30. <property name="title">
  31. <string>Main</string>
  32. </property>
  33. <layout class="QGridLayout" name="gridLayout_2">
  34. <item row="0" column="0">
  35. <widget class="QScrollArea" name="scrollArea">
  36. <property name="widgetResizable">
  37. <bool>true</bool>
  38. </property>
  39. <widget class="QWidget" name="scrollAreaWidgetContents">
  40. <property name="geometry">
  41. <rect>
  42. <x>0</x>
  43. <y>0</y>
  44. <width>450</width>
  45. <height>213</height>
  46. </rect>
  47. </property>
  48. <layout class="QGridLayout" name="gridLayout_5">
  49. <item row="0" column="0">
  50. <widget class="QGroupBox" name="groupBox_2">
  51. <property name="minimumSize">
  52. <size>
  53. <width>0</width>
  54. <height>0</height>
  55. </size>
  56. </property>
  57. <property name="maximumSize">
  58. <size>
  59. <width>5000</width>
  60. <height>5000</height>
  61. </size>
  62. </property>
  63. <property name="title">
  64. <string>Test</string>
  65. </property>
  66. <layout class="QGridLayout" name="gridLayout_3">
  67. <property name="margin">
  68. <number>0</number>
  69. </property>
  70. <item row="0" column="0">
  71. <widget class="QScrollArea" name="scrollArea_2">
  72. <property name="widgetResizable">
  73. <bool>true</bool>
  74. </property>
  75. <widget class="QWidget" name="scrollAreaWidgetContents_2">
  76. <property name="geometry">
  77. <rect>
  78. <x>0</x>
  79. <y>0</y>
  80. <width>221</width>
  81. <height>164</height>
  82. </rect>
  83. </property>
  84. <layout class="QGridLayout" name="gridLayout_4">
  85. <item row="0" column="0">
  86. <widget class="QLabel" name="label">
  87. <property name="text">
  88. <string>TextLabel</string>
  89. </property>
  90. </widget>
  91. </item>
  92. <item row="0" column="1">
  93. <widget class="QLineEdit" name="lineEdit"/>
  94. </item>
  95. <item row="1" column="0">
  96. <widget class="QLabel" name="label_2">
  97. <property name="text">
  98. <string>TextLabel</string>
  99. </property>
  100. </widget>
  101. </item>
  102. <item row="1" column="1">
  103. <widget class="QLineEdit" name="lineEdit_2"/>
  104. </item>
  105. <item row="2" column="0">
  106. <widget class="QLabel" name="label_3">
  107. <property name="text">
  108. <string>TextLabel</string>
  109. </property>
  110. </widget>
  111. </item>
  112. <item row="2" column="1">
  113. <widget class="QLineEdit" name="lineEdit_3"/>
  114. </item>
  115. <item row="3" column="0">
  116. <widget class="QLabel" name="label_4">
  117. <property name="text">
  118. <string>TextLabel</string>
  119. </property>
  120. </widget>
  121. </item>
  122. <item row="3" column="1">
  123. <widget class="QLineEdit" name="lineEdit_4"/>
  124. </item>
  125. </layout>
  126. </widget>
  127. </widget>
  128. </item>
  129. </layout>
  130. </widget>
  131. </item>
  132. <item row="0" column="1">
  133. <spacer name="horizontalSpacer_2">
  134. <property name="orientation">
  135. <enum>Qt::Horizontal</enum>
  136. </property>
  137. <property name="sizeHint" stdset="0">
  138. <size>
  139. <width>40</width>
  140. <height>20</height>
  141. </size>
  142. </property>
  143. </spacer>
  144. </item>
  145. </layout>
  146. </widget>
  147. </widget>
  148. </item>
  149. <item row="1" column="0">
  150. <spacer name="verticalSpacer">
  151. <property name="orientation">
  152. <enum>Qt::Vertical</enum>
  153. </property>
  154. <property name="sizeHint" stdset="0">
  155. <size>
  156. <width>20</width>
  157. <height>40</height>
  158. </size>
  159. </property>
  160. </spacer>
  161. </item>
  162. </layout>
  163. </widget>
  164. </item>
  165. </layout>
  166. </widget>
  167. </widget>
  168. </item>
  169. </layout>
  170. </widget>
  171. <widget class="QMenuBar" name="menuBar">
  172. <property name="geometry">
  173. <rect>
  174. <x>0</x>
  175. <y>0</y>
  176. <width>498</width>
  177. <height>23</height>
  178. </rect>
  179. </property>
  180. </widget>
  181. <widget class="QToolBar" name="mainToolBar">
  182. <attribute name="toolBarArea">
  183. <enum>TopToolBarArea</enum>
  184. </attribute>
  185. <attribute name="toolBarBreak">
  186. <bool>false</bool>
  187. </attribute>
  188. </widget>
  189. <widget class="QStatusBar" name="statusBar"/>
  190. </widget>
  191. <layoutdefault spacing="6" margin="11"/>
  192. <resources/>
  193. <connections/>
  194. </ui>
To copy to clipboard, switch view to plain text mode