[英]PySide.QtGui.QListWidget' object has no attribute 'setItemSelected'
Extremely confused here... trying to select all items in a QListWidget. 这里非常困惑...试图选择QListWidget中的所有项目。 Strangely enough I have done this before fine with this code, but this time it is barking back at me?
奇怪的是,我在使用此代码之前就已经完成了此操作,但是这次它让我望而却步?
# Error: 'PySide.QtGui.QListWidget' object has no attribute 'setItemSelected'
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# ...............
# self.locListWidget.setItemSelected(item, True)
# AttributeError: 'PySide.QtGui.QListWidget' object has no attribute 'setItemSelected' #
if (sizeDimensionLocators > 0):
for loc in dimensionLocators:
self.locListWidget.addItem(loc)
for i in range(self.locListWidget.count()):
item = self.locListWidget.item(i)
self.locListWidget.setItemSelected(item, True) <---------- Issue Here
QListWidget doesn't have a setItemSelected
: QListWidget没有
setItemSelected
:
You can do this though: 您可以这样做:
item.setSelected(true)
You might also need to review the selection mode: 您可能还需要查看选择模式:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.