Reimp the handlers QWidget::enterEvent() and QWidget::leaveEvent(). Open and close the pop up there.