PyQt Enable/Disable elements in a QComboBox
问题 I have a QComboBox that list all Windows' drive letters and let the user choose among them. During the execution, we need to enable or disable some of the letters (without removing them). Here is the basic code : all_letters = ["{}:".format(chr(i)) for i in range(90, 64, -1)] # Z: -> A: all_letters.insert(0, "") cb_letter = QtGui.QComboBox() for l in all_letters: cb_letter.addItem(l) cb_letter.setCurrentIndex(0) I could find a kind of solution (which sounds really complicated) for just