Custom mouseMoveEvent - how to keep default behavior
-
Hi,
I have overwritten mouseMoveEvent() in my QGraphicsView. So far it does what I need.
But now the default behavior for "dragMode = ScrollHandDrag" is broken. Means I can't move the "visible section" does not move any longer,
when I try to click and drag the scene around.How do I keep the default behavior also active / available. Aka how to reimplement the defaults.
void QEnhancedGraphicsView::mouseMoveEvent(QMouseEvent *event) { //I do my stuff here (Getting coordinates) QString text; text = QString("%1 X %2").arg(event->pos().x()).arg(event->pos().y()); QToolTip::showText(this->mapToGlobal(QPoint(event->pos().x(), event->pos().y())), text); emit signalSendCoordinates(event->pos()); }
-
Hi,
I have overwritten mouseMoveEvent() in my QGraphicsView. So far it does what I need.
But now the default behavior for "dragMode = ScrollHandDrag" is broken. Means I can't move the "visible section" does not move any longer,
when I try to click and drag the scene around.How do I keep the default behavior also active / available. Aka how to reimplement the defaults.
void QEnhancedGraphicsView::mouseMoveEvent(QMouseEvent *event) { //I do my stuff here (Getting coordinates) QString text; text = QString("%1 X %2").arg(event->pos().x()).arg(event->pos().y()); QToolTip::showText(this->mapToGlobal(QPoint(event->pos().x(), event->pos().y())), text); emit signalSendCoordinates(event->pos()); }
-
Hi,
I have overwritten mouseMoveEvent() in my QGraphicsView. So far it does what I need.
But now the default behavior for "dragMode = ScrollHandDrag" is broken. Means I can't move the "visible section" does not move any longer,
when I try to click and drag the scene around.How do I keep the default behavior also active / available. Aka how to reimplement the defaults.
void QEnhancedGraphicsView::mouseMoveEvent(QMouseEvent *event) { //I do my stuff here (Getting coordinates) QString text; text = QString("%1 X %2").arg(event->pos().x()).arg(event->pos().y()); QToolTip::showText(this->mapToGlobal(QPoint(event->pos().x(), event->pos().y())), text); emit signalSendCoordinates(event->pos()); }
-
Hi,
I have overwritten mouseMoveEvent() in my QGraphicsView. So far it does what I need.
But now the default behavior for "dragMode = ScrollHandDrag" is broken. Means I can't move the "visible section" does not move any longer,
when I try to click and drag the scene around.How do I keep the default behavior also active / available. Aka how to reimplement the defaults.
void QEnhancedGraphicsView::mouseMoveEvent(QMouseEvent *event) { //I do my stuff here (Getting coordinates) QString text; text = QString("%1 X %2").arg(event->pos().x()).arg(event->pos().y()); QToolTip::showText(this->mapToGlobal(QPoint(event->pos().x(), event->pos().y())), text); emit signalSendCoordinates(event->pos()); }
-
A ademmler has marked this topic as solved on
-
A ademmler has marked this topic as solved on
-
A ademmler has marked this topic as solved on