python - QComboBox mouse press event when combo box is initially pressed PyQt4 -


i'm trying schedule mouse press event qcombobox. wondering if there way schedule mouse press event on initial qcombobox click -- click brings list of items select. i've used currentindexchanged(int) signal call function once user selects 1 of items drop down menu, i'm trying refresh qcombobox list new entries once user clicks on it. (i have feeling approach may misguided, guess that's question.)

i've tried making qcombobox subclass def mousepressevent(self, e), doesn't seem anything. i've tried def mousepressevent(self, e) in qtgui.qwidget class holds qcomboclass object but, unsurprisingly, captures mouse presses qtgui.qwidget.

your current approach is misguided. if working, fail whenever list opened via keyboard.

the correct way override showpopup:

class combobox(qtgui.qcombobox):     def showpopup(self):         self.insertitem(0, 'added')         super(combobox, self).showpopup() 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -