What's about using QWidget::mousePressEvent() and close the widget there?