I try to make a combobox who has 3 item.First of all user is gonna chose one of them and push the button "Select" and then in the text box near them say like "Apple is red" or "Banana is yellow" etc..But i couldnt connect button and combobox.I know there should be .clicked and .activated etc. but I dont know how to use them for this program?
self.button = QPushButton("Select")
self.text = QLineEdit()
self.combo = QComboBox(self)
self.combo.additem("Select one...")
self.combo.additem("Apple")
self.combo.additem("Orange")
self.combo.additem("Banana")
v_box = QVBoxLayout()
v_box.addWidget(self.button)
v_box.addStrecth()
v_box.addWidget(self.combo)
h_box = QHBoxLayout()
h_box.addLayout(v_box)
h_box.addWidget(text)
self.setLayout(h_box)
self.show()
def banana():
print("BANANA IS YELLOW")
def apple():
print("APPLE IS RED")
def orange():
print("ORANGE IS ORANGE")
