Skip to content
Permalink
Browse files

Don't duplicate layer tree node when alt is held

Looks like it duplicates the layer but it really just copies the node
meaning QGIS can get confused

Backport of e49aaed
  • Loading branch information
NathanW2 committed Jul 6, 2017
1 parent 27a9985 commit 708c9e834b82def6e4c75ab9078f217d943486b0
Showing with 12 additions and 0 deletions.
  1. +9 −0 src/gui/layertree/qgslayertreeview.cpp
  2. +3 −0 src/gui/layertree/qgslayertreeview.h
@@ -386,3 +386,12 @@ void QgsLayerTreeView::collapseAllNodes()
_expandAllNodes( layerTreeModel()->rootGroup(), false, layerTreeModel() );
collapseAll();
}

void QgsLayerTreeView::dropEvent( QDropEvent *event )
{
if ( event->keyboardModifiers() & Qt::AltModifier )
{
event->accept();
}
QTreeView::dropEvent( event );
}
@@ -111,6 +111,9 @@ class GUI_EXPORT QgsLayerTreeView : public QTreeView

QgsMapLayer* layerForIndex( const QModelIndex& index ) const;

void dropEvent( QDropEvent *event ) override;


protected slots:

void modelRowsInserted( const QModelIndex& index, int start, int end );

0 comments on commit 708c9e8

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