Skip to content
Permalink
Browse files

Rule copy and paste shortcut keys

  • Loading branch information
NathanW2 committed Sep 14, 2013
1 parent 7c9d859 commit 41ef0a985d14b223382ab1ebf97a5f0f29be9540
@@ -27,8 +27,10 @@ QgsRendererV2Widget::QgsRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* sty
{
contextMenu = new QMenu( "Renderer Options " );

contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mCopyAction = contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
mCopyAction->setShortcut( QKeySequence( QKeySequence::Copy ) );
mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );

contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor( ) ) );
contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
@@ -53,6 +53,8 @@ class GUI_EXPORT QgsRendererV2Widget : public QWidget
QgsVectorLayer* mLayer;
QgsStyleV2* mStyle;
QMenu* contextMenu;
QAction* mCopyAction;
QAction* mPasteAction;

/**Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods
and by connecting the slot contextMenuViewCategories(const QPoint&)*/
@@ -65,6 +65,8 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
mModel = new QgsRuleBasedRendererV2Model( mRenderer );
//new ModelTest( mModel, this ); // for model validity checking
viewRules->setModel( mModel );
viewRules->addAction( mCopyAction );
viewRules->addAction( mPasteAction );

mRefineMenu = new QMenu( tr( "Refine current rule" ), btnRefineRule );
mRefineMenu->addAction( tr( "Add scales to rule" ), this, SLOT( refineRuleScales() ) );

0 comments on commit 41ef0a9

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