close is actually a slot on the QWidget, so you don't need the handleClose method. Hook directly to close.