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

Duplicate on Alt will come at a later date
  • Loading branch information
NathanW2 committed Jul 6, 2017
1 parent a731311 commit e49aaedcb1caf439bef16b61a8edf01b443ac580
Showing with 12 additions and 0 deletions.
  1. +9 −0 src/gui/layertree/qgslayertreeview.cpp
  2. +3 −0 src/gui/layertree/qgslayertreeview.h
@@ -408,3 +408,12 @@ void QgsLayerTreeView::keyPressEvent( QKeyEvent *event )
QTreeView::keyPressEvent( event );
layerTreeModel()->setFlags( oldFlags );
}

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

void dropEvent( QDropEvent *event ) override;


protected slots:

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

0 comments on commit e49aaed

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