def __init__(self, typeList, curType, curID, parent = None):
super(modifyTypeID_Dialog, self).__init__(parent)
self.select_type = typeList[0]
self.select_ID = curID
Vlayout = QtGui.QVBoxLayout(self)
# widget for editing the date
self.cb_label = QtGui.QLabel()
self.cb_label.setText("LaneLine Type: ")
self.sp_label = QtGui.QLabel()
self.sp_label.setText("LaneLine ID: ")
self.cb = QtGui.QComboBox()
self.cb.addItems(typeList)
self.cb.setCurrentIndex(typeList.index(curType))
self.cb.currentIndexChanged.connect(self.type_change)
self.sp = QtGui.QSpinBox()
self.sp.setRange(-128, 127)
self.sp.setValue(curID)
self.sp.valueChanged.connect(self.ID_change)
# add widgets to layout
Hlayout1 = QtGui.QHBoxLayout(self)
Hlayout1.addWidget(self.cb_label)
Hlayout1.addWidget(self.sp_label)
Vlayout.addLayout(Hlayout1)
Hlayout2 = QtGui.QHBoxLayout(self)
Hlayout2.addWidget(self.cb)
Hlayout2.addWidget(self.sp)
Vlayout.addLayout(Hlayout2)
# OK and Cancel buttons
buttons = QDialogButtonBox(
QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
Qt.Horizontal, self)
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
Vlayout.addWidget(buttons)
评论列表
文章目录