qt - How to catch QComboBox popup close event -


a using qcombobox derived class show items. combo box read only. how can catch event when popup view of combo box closes?.
for example, when user clicks mouse button somewhere out of combo box?
thank in advance.

what want event? if qcombobox closes without selection nothing changed. signals given activated when selection has been made.

if insist on reading "close-event", subclass focusoutevent(qfocusevent*) or use event handler focus out event , emit custom signal. want have boolean flag set on hadeditfocus() before, can see if dropdown opened.

edit: easier subclass , reimplement showpopup() , hidepopup() as:

void myclass::showpopup()  {   qcombobox::showpopup();   emit signalpopupshown(); }  void myclass::hidepopup() {   qcombobox::hidepopup();   emit signalpopuphidden(); } 

but not sure if hidepopup() gets called on focus-loose.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -