Skip to content
Permalink
Browse files

[FEATURE] holding shift while pressing cursor keys results in large m…

…ovements in composer
  • Loading branch information
nyalldawson authored and mhugent committed May 22, 2013
1 parent 151e0cc commit f365257e3f12c007b30ccca5c844efa3aacd6024
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/gui/qgscomposerview.cpp
@@ -499,6 +499,14 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
QList<QgsComposerItem*> composerItemList = composition()->selectedComposerItems();
QList<QgsComposerItem*>::iterator itemIt = composerItemList.begin();

// increment used for cursor key item movement
double increment = 1.0;
if ( e->modifiers() & Qt::ShiftModifier )
{
//holding shift while pressing cursor keys results in a big step
increment = 10.0;
}

if ( e->matches( QKeySequence::Copy ) || e->matches( QKeySequence::Cut ) )
{
QDomDocument doc;
@@ -582,7 +590,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
for ( ; itemIt != composerItemList.end(); ++itemIt )
{
( *itemIt )->beginCommand( tr( "Item moved" ), QgsComposerMergeCommand::ItemMove );
( *itemIt )->move( -1.0, 0.0 );
( *itemIt )->move( -1 * increment, 0.0 );
( *itemIt )->endCommand();
}
}
@@ -591,7 +599,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
for ( ; itemIt != composerItemList.end(); ++itemIt )
{
( *itemIt )->beginCommand( tr( "Item moved" ), QgsComposerMergeCommand::ItemMove );
( *itemIt )->move( 1.0, 0.0 );
( *itemIt )->move( increment, 0.0 );
( *itemIt )->endCommand();
}
}
@@ -600,7 +608,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
for ( ; itemIt != composerItemList.end(); ++itemIt )
{
( *itemIt )->beginCommand( tr( "Item moved" ), QgsComposerMergeCommand::ItemMove );
( *itemIt )->move( 0.0, 1.0 );
( *itemIt )->move( 0.0, increment );
( *itemIt )->endCommand();
}
}
@@ -609,7 +617,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
for ( ; itemIt != composerItemList.end(); ++itemIt )
{
( *itemIt )->beginCommand( tr( "Item moved" ), QgsComposerMergeCommand::ItemMove );
( *itemIt )->move( 0.0, -1.0 );
( *itemIt )->move( 0.0, -1 * increment );
( *itemIt )->endCommand();
}
}

0 comments on commit f365257

Please sign in to comment.
You can’t perform that action at this time.