Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Rule copy and paste shortcut keys
- Loading branch information
|
@@ -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() ) ); |
|
|