Skip to content
Permalink
Browse files

Add delete keyboard action for rules

  • Loading branch information
NathanW2 committed Sep 14, 2013
1 parent 41ef0a9 commit c02c28bbcd78cdf18a9f92e1ee6b93af03dba6ed
@@ -32,6 +32,7 @@ QgsRendererV2Widget::QgsRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* sty
mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );

contextMenu->addSeparator();
contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor( ) ) );
contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
contextMenu->addAction( tr( "Change output unit" ), this, SLOT( changeSymbolUnit() ) );
@@ -65,6 +65,11 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
mModel = new QgsRuleBasedRendererV2Model( mRenderer );
//new ModelTest( mModel, this ); // for model validity checking
viewRules->setModel( mModel );

mDeleteAction = new QAction( tr( "Remove Rule"), this );
mDeleteAction->setShortcut( QKeySequence( QKeySequence::Delete ) );

viewRules->addAction( mDeleteAction );
viewRules->addAction( mCopyAction );
viewRules->addAction( mPasteAction );

@@ -89,6 +94,7 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
connect( btnAddRule, SIGNAL( clicked() ), this, SLOT( addRule() ) );
connect( btnEditRule, SIGNAL( clicked() ), this, SLOT( editRule() ) );
connect( btnRemoveRule, SIGNAL( clicked() ), this, SLOT( removeRule() ) );
connect( mDeleteAction, SIGNAL( triggered() ), this, SLOT( removeRule() ) );
connect( btnCountFeatures, SIGNAL( clicked() ), this, SLOT( countFeatures() ) );

connect( btnRenderingOrder, SIGNAL( clicked() ), this, SLOT( setRenderingOrder() ) );
@@ -142,6 +142,7 @@ class GUI_EXPORT QgsRuleBasedRendererV2Widget : public QgsRendererV2Widget, priv
QgsRuleBasedRendererV2Model* mModel;

QMenu* mRefineMenu;
QAction* mDeleteAction;

protected slots:
void copy();

0 comments on commit c02c28b

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