import QtQuick 2.0import aux.tools 1.0/** * Used to stop mouse events propagation to lower items on the stack. * MouseBlocker is a c++ class. * See Contentx.cpp and gui/MouseBlocker.cpp */Rectangle { MouseBlocker {anchors.fill: parent}}
#include "gui/MouseBlocker.h"#include "common/setDebugNew.h"MouseBlocker::MouseBlocker(QQuickItem *parent): QQuickItem(parent){ //setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::AllButtons); setCursor(Qt::ArrowCursor);}//------------------------------------------------------------------------------void MouseBlocker::hoverEnterEvent(QHoverEvent *event){ event->accept();}//------------------------------------------------------------------------------void MouseBlocker::hoverLeaveEvent(QHoverEvent *event){ event->accept();}//------------------------------------------------------------------------------void MouseBlocker::hoverMoveEvent(QHoverEvent *event){ event->accept();} void MouseBlocker::mouseMoveEvent(QMouseEvent *event){ event->accept();}//------------------------------------------------------------------------------void MouseBlocker::mousePressEvent(QMouseEvent *event){ event->accept();}//------------------------------------------------------------------------------void MouseBlocker::mouseReleaseEvent(QMouseEvent *event){ event->accept();}//------------------------------------------------------------------------------void MouseBlocker::wheelEvent(QWheelEvent *event){ event->accept();}//------------------------------------------------------------------------------