Python qt - select random item on combo box? -
how select random item on combo box, when button pressed?
sorry, realy have no clue how done.
you can implement custom mouse event, when pressing randomly select selected item index:
import random class randcombobox(qcombobox): ... def mousepressevent (self, qmouseevent e): self.setcurrentindex(random.randint(0, self.count()))
Comments
Post a Comment