Skip to content

Commit

Permalink
add CopyAction to the list of supported drop actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jan 27, 2016
1 parent ae3cfd4 commit b66002d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/gui/layertree/qgscustomlayerorderwidget.cpp
Expand Up @@ -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 );

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



///@cond PRIVATE

CustomLayerOrderModel::CustomLayerOrderModel( QgsLayerTreeMapCanvasBridge* bridge, QObject* parent )
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/gui/layertree/qgslayertreeview.cpp
Expand Up @@ -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 ) ) );
Expand Down

0 comments on commit b66002d

Please sign in to comment.