在以下代码中使用按位或运算符如何防止被覆盖?我知道按位或如何处理数字,但我无法理解它在这里的用途:item.flags() | QtCore.Qt.ItemIsEditableQtCore
item.flags
import sys
from PySide import QtCore, QtGui
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
app.setStyle("cleanLooks")
#Data
dataList = ["one", "two", "three", "four", "five"]
#Creating item based QlistWidget
listWidget = QtGui.QListWidget()
listWidget.addItems(dataList)
listWidget.show()
#Make all items of the listWidget editable
count = listWidget.count()
for i in range(count):
item = listWidget.item(i)
item.setFlags(item.flags() | QtCore.Qt.ItemIsEditable)
#Creating item based QComboBox
comboBoxWidget = QtGui.QComboBox()
comboBoxWidget.addItems(dataList)
comboBoxWidget.show()
sys.exit(app.exec_())