Disable MouseEvent function
Good Day,
Subclassed QGraphicsView
Created functions for mouseMove & mousePressed events accordingly
after that a user must be given the option to move the image in graphicsView
how do I disable the mouseEvent functions so the user can move the image
Code:
newImage2
->setFlag
(QGraphicsItem::ItemIsMovable);
// this does not work because the mouse events were overridden
Is there a way I can create a Toggle button of sorts to decide which mouseEvent must be called
Ideas please
Kind Regards
Re: Disable MouseEvent function
Call the base class implementation from your event handler.
Re: Disable MouseEvent function
use event filter with mouseevent ..
Code:
{
if (watched
== chatEdit
&& e
->type
() == QEvent::MouseEvent) { /** ignore it */
return true;
}
}
return QWidget::eventFilter(watched, e
);
}
and dont forget to install it and remove whenever it required ..
view->installEventFilter(this);