mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Keep composer multi-item selection only when Shift is pressed during click
- Fixes issues where Shift was still registered as pressed when shift click happened outside of view (due to lingering keyboard focus)
This commit is contained in:
parent
4a36cbdda8
commit
2fe847c9cf
@ -67,7 +67,6 @@ class QgsComposerView: QGraphicsView
|
||||
void mouseDoubleClickEvent( QMouseEvent* e );
|
||||
|
||||
void keyPressEvent( QKeyEvent * e );
|
||||
void keyReleaseEvent( QKeyEvent * e );
|
||||
|
||||
void wheelEvent( QWheelEvent* event );
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WFlags f )
|
||||
: QGraphicsView( parent )
|
||||
, mShiftKeyPressed( false )
|
||||
, mRubberBandItem( 0 )
|
||||
, mRubberBandLineItem( 0 )
|
||||
, mMoveContentItem( 0 )
|
||||
@ -84,7 +83,7 @@ void QgsComposerView::mousePressEvent( QMouseEvent* e )
|
||||
//select/deselect items and pass mouse event further
|
||||
case Select:
|
||||
{
|
||||
if ( !mShiftKeyPressed ) //keep selection if shift key pressed
|
||||
if ( !( e->modifiers() & Qt::ShiftModifier ) ) //keep selection if shift key pressed
|
||||
{
|
||||
composition()->clearSelection();
|
||||
}
|
||||
@ -449,10 +448,6 @@ void QgsComposerView::mouseDoubleClickEvent( QMouseEvent* e )
|
||||
void QgsComposerView::keyPressEvent( QKeyEvent * e )
|
||||
{
|
||||
//TODO : those should be actions (so we could also display menu items and/or toolbar items)
|
||||
if ( e->key() == Qt::Key_Shift )
|
||||
{
|
||||
mShiftKeyPressed = true;
|
||||
}
|
||||
|
||||
if ( !composition() )
|
||||
{
|
||||
@ -562,14 +557,6 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposerView::keyReleaseEvent( QKeyEvent * e )
|
||||
{
|
||||
if ( e->key() == Qt::Key_Shift )
|
||||
{
|
||||
mShiftKeyPressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposerView::wheelEvent( QWheelEvent* event )
|
||||
{
|
||||
QPointF scenePoint = mapToScene( event->pos() );
|
||||
|
@ -96,7 +96,6 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
|
||||
void mouseDoubleClickEvent( QMouseEvent* e );
|
||||
|
||||
void keyPressEvent( QKeyEvent * e );
|
||||
void keyReleaseEvent( QKeyEvent * e );
|
||||
|
||||
void wheelEvent( QWheelEvent* event );
|
||||
|
||||
@ -106,8 +105,6 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
|
||||
void showEvent( QShowEvent* e );
|
||||
|
||||
private:
|
||||
/**Status of shift key (used for multiple selection)*/
|
||||
bool mShiftKeyPressed;
|
||||
/**Current composer tool*/
|
||||
QgsComposerView::Tool mCurrentTool;
|
||||
/**Rubber band item*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user