Skip to content
Permalink
Browse files

add CopyAction to the list of supported drop actions

  • Loading branch information
alexbruy committed Jan 27, 2016
1 parent ae3cfd4 commit b66002d0abd4f20215deebada584c1dd72735014
@@ -915,7 +915,7 @@ void QgsLayerTreeModel::recursivelyEmitDataChanged( const QModelIndex& idx )

Qt::DropActions QgsLayerTreeModel::supportedDropActions() const
{
return Qt::MoveAction;
return Qt::CopyAction | Qt::MoveAction;
}

QStringList QgsLayerTreeModel::mimeTypes() const
@@ -39,8 +39,8 @@ QgsCustomLayerOrderWidget::QgsCustomLayerOrderWidget( QgsLayerTreeMapCanvasBridg
mView->setDragEnabled( true );
mView->setAcceptDrops( true );
mView->setDropIndicatorShown( true );
mView->setDragDropMode( QAbstractItemView::InternalMove );
mView->setSelectionMode( QAbstractItemView::ExtendedSelection );
mView->setDefaultDropAction( Qt::MoveAction );

mView->setModel( mModel );

@@ -91,6 +91,7 @@ void QgsCustomLayerOrderWidget::modelUpdated()
}



///@cond PRIVATE

CustomLayerOrderModel::CustomLayerOrderModel( QgsLayerTreeMapCanvasBridge* bridge, QObject* parent )
@@ -155,7 +156,7 @@ Qt::ItemFlags CustomLayerOrderModel::flags( const QModelIndex& index ) const

Qt::DropActions CustomLayerOrderModel::supportedDropActions() const
{
return Qt::MoveAction;
return Qt::CopyAction | Qt::MoveAction;
}

QStringList CustomLayerOrderModel::mimeTypes() const
@@ -38,6 +38,7 @@ QgsLayerTreeView::QgsLayerTreeView( QWidget *parent )
setExpandsOnDoubleClick( false ); // normally used for other actions

setSelectionMode( ExtendedSelection );
setDefaultDropAction( Qt::MoveAction );

connect( this, SIGNAL( collapsed( QModelIndex ) ), this, SLOT( updateExpandedStateToNode( QModelIndex ) ) );
connect( this, SIGNAL( expanded( QModelIndex ) ), this, SLOT( updateExpandedStateToNode( QModelIndex ) ) );

0 comments on commit b66002d

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