我的屏幕外面的桌子
这是我选择框代码的一部分,我在Linux上对其进行了测试,一切都很完美。但是当在Windows10上测试时,选择框超出了我的屏幕,我设置了光标位置框的位置。当盒子不在屏幕上时,我怎么把盒子放起来
self.edit = QLineEdit()
self.edit.setText(text)
self.edit.setValidator(labelValidator())
self.edit.editingFinished.connect(self.postProcess)
model = QStringListModel()
model.setStringList(listItem)
completer = QCompleter()
completer.setModel(model)
self.edit.setCompleter(completer)
layout = QVBoxLayout()
layout.addWidget(self.edit)
self.buttonBox = bb = BB(BB.Ok | BB.Cancel, Qt.Horizontal, self)
bb.button(BB.Ok).setIcon(newIcon('done'))
bb.button(BB.Cancel).setIcon(newIcon('undo'))
bb.accepted.connect(self.validate)
bb.rejected.connect(self.reject)
layout.addWidget(bb)
if listItem is not None and len(listItem) > 0:
self.listWidget = QListWidget(self)
for item in listItem:
self.listWidget.addItem(item)
self.listWidget.itemClicked.connect(self.listItemClick)
self.listWidget.itemDoubleClicked.connect(self.listItemDoubleClick)
layout.addWidget(self.listWidget)
self.setLayout(layout)
ubuntu上没有这个问题,但是win10就像图片一样