Skip to content

Commit

Permalink
Don't duplicate layer tree node when alt is held
Browse files Browse the repository at this point in the history
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 708c9e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/layertree/qgslayertreeview.cpp
Expand Up @@ -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 );
}
3 changes: 3 additions & 0 deletions src/gui/layertree/qgslayertreeview.h
Expand Up @@ -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 );
Expand Down

0 comments on commit 708c9e8

Please sign in to comment.