+ if (obj == parent()) {
+ switch (event->type()) {
+ case QEvent::Leave:
+ hide();
+ break;
+
+ case QEvent::MouseMove:
+ if (m_isHovered) {
+ // Don't forward mouse move events to the viewport,
+ // otherwise a rubberband selection will be shown when
+ // clicking on the selection toggle and moving the mouse
+ // above the viewport.
+ return true;
+ }
+ break;
+
+ default:
+ break;
+ }