Hey high_flyer,

thanks again for the help.
I've reduced the code to have only two radio buttons inside the grid layout which self is inside a scroll area. Nevertheless here comes the code:

Qt Code:
  1. # -*- coding: utf-8 -*-
  2.  
  3. # Form implementation generated from reading ui file 'test.ui'
  4. #
  5. # Created by: PyQt4 UI code generator 4.11.4
  6. #
  7. # WARNING! All changes made in this file will be lost!
  8.  
  9. from PyQt4 import QtCore, QtGui
  10.  
  11. try:
  12. _fromUtf8 = QtCore.QString.fromUtf8
  13. except AttributeError:
  14. def _fromUtf8(s):
  15. return s
  16.  
  17. try:
  18. _encoding = QtGui.QApplication.UnicodeUTF8
  19. def _translate(context, text, disambig):
  20. return QtGui.QApplication.translate(context, text, disambig, _encoding)
  21. except AttributeError:
  22. def _translate(context, text, disambig):
  23. return QtGui.QApplication.translate(context, text, disambig)
  24.  
  25. class Ui_Dialog(object):
  26. def setupUi(self, Dialog):
  27. Dialog.setObjectName(_fromUtf8("Dialog"))
  28. Dialog.resize(485, 785)
  29. Dialog.setMinimumSize(QtCore.QSize(485, 400))
  30. Dialog.setMaximumSize(QtCore.QSize(495, 785))
  31. Dialog.setSizeIncrement(QtCore.QSize(1, 1))
  32. Dialog.setMouseTracking(False)
  33. Dialog.setAutoFillBackground(False)
  34. Dialog.setModal(False)
  35. self.layoutWidget = QtGui.QWidget(Dialog)
  36. self.layoutWidget.setGeometry(QtCore.QRect(10, 736, 471, 49))
  37. self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
  38. self.SaveCancelLayout = QtGui.QHBoxLayout(self.layoutWidget)
  39. self.SaveCancelLayout.setContentsMargins(0, 8, 5, 0)
  40. self.SaveCancelLayout.setSpacing(10)
  41. self.SaveCancelLayout.setObjectName(_fromUtf8("SaveCancelLayout"))
  42. self.cancelButton = QtGui.QPushButton(self.layoutWidget)
  43. self.cancelButton.setMaximumSize(QtCore.QSize(200, 40))
  44. self.cancelButton.setLayoutDirection(QtCore.Qt.LeftToRight)
  45. self.cancelButton.setObjectName(_fromUtf8("cancelButton"))
  46. self.SaveCancelLayout.addWidget(self.cancelButton)
  47. self.scrollArea = QtGui.QScrollArea(Dialog)
  48. self.scrollArea.setGeometry(QtCore.QRect(10, 40, 471, 691))
  49. self.scrollArea.setWidgetResizable(True)
  50. self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
  51. self.scrollAreaWidgetContents = QtGui.QWidget()
  52. self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 469, 689))
  53. self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
  54. self.layoutWidget1 = QtGui.QWidget(self.scrollAreaWidgetContents)
  55. self.layoutWidget1.setGeometry(QtCore.QRect(0, 20, 471, 631))
  56. self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
  57. self.gridLayout = QtGui.QGridLayout(self.layoutWidget1)
  58. self.gridLayout.setMargin(9)
  59. self.gridLayout.setSpacing(6)
  60. self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
  61. self.line_4 = QtGui.QFrame(self.layoutWidget1)
  62. self.line_4.setMaximumSize(QtCore.QSize(465, 16777215))
  63. self.line_4.setFrameShape(QtGui.QFrame.HLine)
  64. self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
  65. self.line_4.setObjectName(_fromUtf8("line_4"))
  66. self.gridLayout.addWidget(self.line_4, 0, 0, 1, 4)
  67. self.logEnable = QtGui.QRadioButton(self.layoutWidget1)
  68. font = QtGui.QFont()
  69. font.setBold(True)
  70. font.setWeight(75)
  71. self.logEnable.setFont(font)
  72. self.logEnable.setChecked(True)
  73. self.logEnable.setObjectName(_fromUtf8("logEnable"))
  74. self.buttonGroup_logging = QtGui.QButtonGroup(Dialog)
  75. self.buttonGroup_logging.setObjectName(_fromUtf8("buttonGroup_logging"))
  76. self.buttonGroup_logging.addButton(self.logEnable)
  77. self.gridLayout.addWidget(self.logEnable, 1, 1, 1, 1)
  78. self.logDisable = QtGui.QRadioButton(self.layoutWidget1)
  79. font = QtGui.QFont()
  80. font.setBold(True)
  81. font.setWeight(75)
  82. self.logDisable.setFont(font)
  83. self.logDisable.setObjectName(_fromUtf8("logDisable"))
  84. self.buttonGroup_logging.addButton(self.logDisable)
  85. self.gridLayout.addWidget(self.logDisable, 1, 2, 1, 1)
  86. self.scrollArea.setWidget(self.scrollAreaWidgetContents)
  87.  
  88. self.retranslateUi(Dialog)
  89. QtCore.QMetaObject.connectSlotsByName(Dialog)
  90.  
  91. def retranslateUi(self, Dialog):
  92. Dialog.setWindowTitle(_translate("Dialog", "Test Editor", None))
  93. self.cancelButton.setText(_translate("Dialog", "Stop and exit", None))
  94. self.logEnable.setText(_translate("Dialog", "enable logfile", None))
  95. self.logDisable.setText(_translate("Dialog", "disable logfile", None))
  96.  
  97.  
  98. if __name__ == "__main__":
  99. import sys
  100. app = QtGui.QApplication(sys.argv)
  101. Dialog = QtGui.QDialog()
  102. ui = Ui_Dialog()
  103. ui.setupUi(Dialog)
  104. Dialog.show()
  105. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode