1

I am trying to catch the closeEvent of a QDockWidget in my GUI. But destroyed() doesn't work and I have tried everything else I can't seem to get it to work.

What would be the simplest solution for this. Maybe a two liner. Just to catch the Qdockwidget exit event and then print something for instance. I have used Qt designer to create that widget.

cheers Anns

A I
  • 161
  • 6
  • 20
  • `def fn(): print('something'); dock.closeEvent = fn`. – ekhumoro Jan 09 '17 at 15:03
  • thank you so much for this. The only problem it is also triggered when the dockwidget is undocked or so. So it is a bit painful but thank you! – A I Jan 12 '17 at 17:19
  • There may be a better solution - but it depends on specifiying exactly what you want to achieve. What do you mean by "exit event"? Some possibilities are: (1) application exit, (2) dock deleted, (3) dock closed (hidden), (4) dock undocked. – ekhumoro Jan 12 '17 at 17:43

0 Answers0