Once an item is selected on a combo, it should get removed from the others, unless it's "No use".
I made three options of QComboBox, and each of those contains the same items.
The explanation is this:
QCombobox Tug 1 has total 4 items ('No Use', '207HR', '306DR', 'Jupiter')
QCombobox Tug 2 has total 4 items ('No Use', '207HR', '306DR', 'Jupiter')
QCombobox Tug 3 has total 4 items ('No Use', '207HR', '306DR', 'Jupiter')
The default value of those Qcombobox is 'No Use'.
How can I remove the selected value of QComboBox Tug 1 from QComboBox Tug 2?
The point is that 'No Use' shall not be removed; only an item from among '207HR', '306DR', and 'Jupiter'.
The Code i made is below:
class Ship_Use_Tug_Input_Program(QWidget):
def __init__(self, master):
super().__init__()
self.initUI()
def initUI(self):
tug1_cb = QComboBox(self)
jeju_tug = ['No use','207HR (2,500HP)', '306DR (3,600HP)', 'Jupiter (3,600HP)']
tug1_cb.addItems(jeju_tug)
tug2_cb = QComboBox(self)
tug2_cb.addItems(jeju_tug)
tug3_cb = QComboBox(self)
tug3_cb.addItems(jeju_tug)
self.setGeometry(100,100,1000,500)
self.setWindowTitle('Ship_Use_Tug_Input_Program')
self.show()
app = QApplication(sys.argv)
exc = Ship_Use_Tug_Input_Program(master=Ship_Use_Tug_Input_Program)
app.exec_()