Commit 188f0765 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] - during pan, leaving the widget with mouse and rightclicking somewhere...

[FIX] - during pan, leaving the widget with mouse and rightclicking somewhere else caused the pan to continue. This is fixed now.
parent 235be7b4
......@@ -52,6 +52,19 @@ QPointF WQtNetworkEditorView::getCenter()
return m_currentCenterPoint;
}
void WQtNetworkEditorView::leaveEvent( QEvent* event )
{
// are we in pan mode?
if( !m_lastPanPoint.isNull() )
{
// if the widget is left by the mouse during pan: deactivate pan
m_lastPanPoint = QPoint();
}
// forward
QGraphicsView::leaveEvent( event );
}
void WQtNetworkEditorView::mousePressEvent( QMouseEvent* event )
{
// only pan if no element is hit
......
......@@ -103,6 +103,13 @@ protected:
*/
void keyPressEvent( QKeyEvent *event );
/**
* Mouse leaves the widget.
*
* \param event the event
*/
void leaveEvent( QEvent* event );
private:
/**
* The currently set centerpoint.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment