mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-27 00:07:16 -05:00
Fix paintbrush editing tool movement
This commit is contained in:
parent
9b4abd4bf1
commit
9c2020c703
@ -300,6 +300,9 @@ bool Qgs3DMapCanvas::eventFilter( QObject *watched, QEvent *event )
|
||||
case QEvent::KeyPress:
|
||||
mMapTool->keyPressEvent( static_cast<QKeyEvent *>( event ) );
|
||||
break;
|
||||
case QEvent::KeyRelease:
|
||||
mMapTool->keyReleaseEvent( static_cast<QKeyEvent *>( event ) );
|
||||
break;
|
||||
case QEvent::Wheel:
|
||||
mMapTool->mouseWheelEvent( static_cast<QWheelEvent *>( event ) );
|
||||
break;
|
||||
|
||||
@ -44,6 +44,11 @@ void Qgs3DMapTool::keyPressEvent( QKeyEvent *event )
|
||||
Q_UNUSED( event )
|
||||
}
|
||||
|
||||
void Qgs3DMapTool::keyReleaseEvent( QKeyEvent *event )
|
||||
{
|
||||
Q_UNUSED( event )
|
||||
}
|
||||
|
||||
void Qgs3DMapTool::mouseWheelEvent( QWheelEvent *event )
|
||||
{
|
||||
Q_UNUSED( event )
|
||||
|
||||
@ -50,6 +50,8 @@ class _3D_EXPORT Qgs3DMapTool : public QObject
|
||||
virtual void mouseMoveEvent( QMouseEvent *event );
|
||||
//! Reimplement to handle key press \a event forwarded by the parent Qgs3DMapCanvas
|
||||
virtual void keyPressEvent( QKeyEvent *event );
|
||||
//! Reimplement to handle key release \a event forwarded by the parent Qgs3DMapCanvas
|
||||
virtual void keyReleaseEvent( QKeyEvent *event );
|
||||
//! Reimplement to handle mouse wheel \a event forwarded by the parent Qgs3DMapCanvas
|
||||
virtual void mouseWheelEvent( QWheelEvent *event );
|
||||
|
||||
|
||||
@ -490,6 +490,7 @@ void Qgs3DMapCanvasWidget::changePointCloudAttributeByPaintbrush()
|
||||
if ( !action )
|
||||
return;
|
||||
|
||||
mCanvas->requestActivate();
|
||||
mCanvas->setMapTool( nullptr );
|
||||
mMapToolChangeAttribute.reset( new Qgs3DMapToolPointCloudChangeAttributePaintbrush( mCanvas ) );
|
||||
onPointCloudChangeAttributeSettingsChanged();
|
||||
|
||||
@ -157,10 +157,18 @@ void Qgs3DMapToolPointCloudChangeAttributePaintbrush::keyPressEvent( QKeyEvent *
|
||||
restart();
|
||||
}
|
||||
|
||||
if ( !mIsClicked && event->key() == Qt::Key_Space )
|
||||
if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
|
||||
{
|
||||
const bool newState = !mCanvas->cameraController()->hasInputHandlersEnabled();
|
||||
mCanvas->cameraController()->setInputHandlersEnabled( newState );
|
||||
mIsMoving = newState;
|
||||
mCanvas->cameraController()->setInputHandlersEnabled( true );
|
||||
mIsMoving = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Qgs3DMapToolPointCloudChangeAttributePaintbrush::keyReleaseEvent( QKeyEvent *event )
|
||||
{
|
||||
if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
|
||||
{
|
||||
mCanvas->cameraController()->setInputHandlersEnabled( false );
|
||||
mIsMoving = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ class Qgs3DMapToolPointCloudChangeAttributePaintbrush : public Qgs3DMapToolPoint
|
||||
void mouseMoveEvent( QMouseEvent *event ) override;
|
||||
void mouseWheelEvent( QWheelEvent *event ) override;
|
||||
void keyPressEvent( QKeyEvent *event ) override;
|
||||
void keyReleaseEvent( QKeyEvent *event ) override;
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user