mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
sort the indexes when generating layer tree mime data (fixes #4110)
This commit is contained in:
parent
bf79ecc779
commit
afef14bf3c
@ -928,7 +928,11 @@ QStringList QgsLayerTreeModel::mimeTypes() const
|
||||
|
||||
QMimeData* QgsLayerTreeModel::mimeData( const QModelIndexList& indexes ) const
|
||||
{
|
||||
QList<QgsLayerTreeNode*> nodesFinal = indexes2nodes( indexes, true );
|
||||
// Sort the indexes. Depending on how the user selected the items, the indexes may be unsorted.
|
||||
QModelIndexList sortedIndexes = indexes;
|
||||
qSort( sortedIndexes.begin(), sortedIndexes.end(), qLess<QModelIndex>() );
|
||||
|
||||
QList<QgsLayerTreeNode*> nodesFinal = indexes2nodes( sortedIndexes, true );
|
||||
|
||||
if ( nodesFinal.count() == 0 )
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user