I have a simple GUI built using python and PyQt4. After the user enters something into the program, the program should then add a certain number of checkboxes to the UI depending on what the user's input was. For testing purposes, I have one checkbox existing in the application from start, and that checkbox is nested inside of a QVBoxLayout, which is nested inside of a QGroupBox. I have tried reading through the PyQt4 documentation for all of this, but I have struggled to make any progress.
Here is how I am making the initial checkbox (basic output from QtCreator):
self.CheckboxField = QtGui.QGroupBox(self.GuiMain)
self.CheckboxField.setGeometry(QtCore.QRect(10, 70, 501, 41))
self.CheckboxField.setObjectName("CheckboxField")
self.verticalLayoutWidget = QtGui.QWidget(self.CheckboxField)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 10, 491, 21))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.CheckboxLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.CheckboxLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
self.CheckboxLayout.setObjectName("CheckboxLayout")
self.checkBox = QtGui.QCheckBox(self.verticalLayoutWidget)
self.checkBox.setObjectName("checkBox")
self.CheckboxLayout.addWidget(self.checkBox)
Then here is my initial attempt to add a new checkbox (in a seperate file):
checkBox1 = QtGui.QCheckBox(self.window.CheckboxField)
checkBox1.setGeometry(QtCore.QRect(90, 10, 70, 17))
checkBox1.setText(QtGui.QApplication.translate("MainWindow", "Bob Oblaw", None, QtGui.QApplication.UnicodeUTF8))
checkBox1.setObjectName("checkBox1")
self.window.CheckboxLayout.addWidget(checkBox1)
self.window.CheckboxLayout.stretch(1)
self.window.CheckboxField.adjustSize()
self.window.CheckboxField.update()
There are no errors, the checkbox just doesn't show up.