如何在 PyQT UI 中创建一个选项卡,其布局包含以下示例。
选项卡名称-MNOP
布局有。
- a1:可以输入数据(数字)的文本框
- a2: textbox hat 可以输入数据
- a3:可以输入数据的文本框
- a4:可以输入数据的文本框
数据输入将存储在数据库中并用于创建条形图。现在我需要创建选项卡和文本框。
现在,我正在处理以下不完整但不知道如何继续。
class RPBDlg(QDialog):
def __init__(self, parent=None):
super(RPBDlg, self).__init__(parent)
self.newcounter =0
grid = QGridLayout()
label = QLabel()
label.setText("<B>Plan Title:</B>")
self.titleEdit = QLineEdit()
grid.addWidget(label,0,0,1,1)
grid.addWidget(self.titleEdit,0,1,1,1)
label2 = QLabel("<B>Type of Plan</B>")
self.typeEdit = QComboBox()
self.typeEdit.addItems(["STI","LTI","STI and LTI"])
grid.addWidget(label2,1,0,1,1)
grid.addWidget(self.typeEdit,1,1,1,1)
self.bonusPool = QCheckBox("Bonus Pool")
grid.addWidget(self.bonusPool,1,4,1,1)
label3 = QLabel("<B>Sub-Type of Plan<B>")
self.subTypeEdit = QComboBox()
self.subTypeEdit.addItems(["Regular","Profit Sharing","Multiplier Based"])
grid.addWidget(label3,1,2,1,1)
grid.addWidget(self.subTypeEdit,1,3,1,1)
self.label4 = QLabel("<B>Are individual awards determined <br>through a performance formula?")
self.bonusPoolAdditional = QComboBox()
self.bonusPoolAdditional.addItems(["Yes - separate formula for individual awards","Yes - individual awards are proportional to bonus pool", "No - individual awards are discretionary","No - individual awards determined through negative discretion"])
grid.addWidget(self.label4,3,0,1,1)
grid.addWidget(self.bonusPoolAdditional,3,1,1,2)
存在进口。此代码是更大代码的一部分。