Update 03-11-01-06

QComboBox-信号:启用可编辑功能,以便于测试editTextChanged信号
This commit is contained in:
muzing 2022-07-24 11:25:34 +08:00
parent f01b582d55
commit ad0d9ee6f3

View File

@ -48,6 +48,8 @@ class MyWidget(QtWidgets.QWidget):
self.cbb = QtWidgets.QComboBox(self)
self.cbb.move(300, 200)
self.cbb.addItems([str(i) for i in range(100, 105)]) # 通过列表推导式快速添加多个条目
self.cbb.setEditable(True) # 启用可编辑
self.cbb.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) # 总是根据内容调整尺寸
self.info_label = QtWidgets.QLabel(self)
self.info_label.move(300, 300)