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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -